NAME

XML::Feed::JavaScript - Serialize XML feeds as JavaScript

SYNOPSIS

use XML::Feed::JavaScript;

my $feed = XML::Feedi::JavaScript->parse(URI->new('http://example.com/atom.xml'))
       or die XML::Feed::JavaScript->errstr;
print $feed->as_javascript;

DESCRIPTION

XML::Feed::JavaScript allows you to serialize XML feeds as JavaScript by using XML::Feed syndication feed parser for both RSS and Atom feeds.

XML::Feed::JavaScript supports Perl version 5.6.1 or later.

METHODS

as_javascript ( [$opt] )

print $feed->as_javascript({
    max      => $max,
    encoding => $encoding,
    tmpl_opt => {
        filename => $filename,
        die_on_bad_params => 0,
    },
});
  • max

    Limit the maximum of entries.

  • encoding

    Pass in the encoding you wish to get JavaScript by. If not passed in, default value 'utf8' will be set. See the documentation of Encode for more detail.

  • tmpl_opt

    Set the options for HTML::Template, but as hashref. See the documentation of HTML::Template for more detail.

save_javascript ( filename, [$opt] )

Pass in the filename you wish to save your JavaScript in. Optionally you can pass in $opt in the same manner as as_javascript() above.

SEE ALSO

AUTHOR

Kentaro Kuribayashi, <kentarok@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Kentaro Kuribayashi

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.