Bible::OBML::Gateway - Bible Gateway content conversion to Open Bible Markup Language (OBML)
version 1.11
use Bible::OBML::Gateway; my $bg = Bible::OBML::Gateway->new; $bg->translation('NIV'); my $obml = $bg->get( 'Romans 12', 'NIV' )->obml; my $data = $bg->get( 'Romans 12' )->data; my $html = $bg->get('Romans 12')->html; $bg->get( 'Romans 12', 'NIV' )->save('Romans_12_NIV.html'); say $bg->load('Romans_12_NIV.html')->obml;
This module consumes Bible Gateway content and converts it to Open Bible Markup Language (OBML).
The following methods are supported.
Instantiates a new gateway object. You can optionally pass a translation acronym to be used on subsequent requests.
my $bg = Bible::OBML::Gateway->new( translation => 'NIV' );
Get or set the current translation acronym.
say $bg->translation; $bg->translation('NIV');
Gets the raw HTML content for a given chapter represented by book, chapter, and translation. The book and chapter can be combined with a space. The translation if provided will override the translation set in the object.
$bg->get( 'Romans 12', 'NIV' ); $bg->get('Romans 12');
Parses the previously get()-ed raw HTML if it hasn't been parsed yet and returns Open Bible Markup Language (OBML) using Bible::OBML.
get()
my $obml = $bg->get('Romans 12')->obml;
Parses the previously get()-ed raw HTML if it hasn't been parsed yet and returns a data structure of content that could be passed into Bible::OBML's render() method.
render()
my $data = $bg->get('Romans 12')->data;
Returns the previously get()-ed raw HTML.
my $html = $bg->get('Romans 12')->html;
Saves the previously get()-ed raw HTML to a file.
$bg->get('Romans 12')->save('Romans_12_NIV.html');
Loads raw HTML from a file.
say $bg->load('Romans_12_NIV.html')->obml;
Bible::OBML, Bible::OBML::HTML, Bible::Reference.
You can also look for additional information at:
GitHub
MetaCPAN
GitHub Actions
Codecov
CPANTS
CPAN Testers
Gryphon Shafer <gryphon@cpan.org>
This software is Copyright (c) 2017-2021 by Gryphon Shafer.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Bible::OBML::Gateway, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bible::OBML::Gateway
CPAN shell
perl -MCPAN -e shell install Bible::OBML::Gateway
For more information on module installation, please visit the detailed CPAN module installation guide.