The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bible::OBML::Gateway - Bible Gateway content conversion to Open Bible Markup Language (OBML)

VERSION

version 1.11

SYNOPSIS

    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;

DESCRIPTION

This module consumes Bible Gateway content and converts it to Open Bible Markup Language (OBML).

METHODS

The following methods are supported.

new

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' );

translation

Get or set the current translation acronym.

    say $bg->translation;
    $bg->translation('NIV');

get

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');

obml

Parses the previously get()-ed raw HTML if it hasn't been parsed yet and returns Open Bible Markup Language (OBML) using Bible::OBML.

    my $obml = $bg->get('Romans 12')->obml;

data

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.

    my $data = $bg->get('Romans 12')->data;

html

Returns the previously get()-ed raw HTML.

    my $html = $bg->get('Romans 12')->html;

save

Saves the previously get()-ed raw HTML to a file.

    $bg->get('Romans 12')->save('Romans_12_NIV.html');

load

Loads raw HTML from a file.

    say $bg->load('Romans_12_NIV.html')->obml;

SEE ALSO

Bible::OBML, Bible::OBML::HTML, Bible::Reference.

You can also look for additional information at:

AUTHOR

Gryphon Shafer <gryphon@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017-2021 by Gryphon Shafer.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)