XML::FeedPP::Plugin::DumpJSON - FeedPP Plugin for generating JSON
use XML::FeedPP; my $feed = XML::FeedPP->new( 'index.rss' ); $feed->limit_item( 10 ); $feed->call( DumpJSON => 'index-rss.json' );
This plugin generates a JSON data representation.
If a JSON filename is undef or '', this module returns a JSON string instead of generating a JSON file.
undef
''
$feed->call( DumpJSON => 'feed.json' ); # generates a JSON file my $json = $feed->call( 'DumpJSON' ); # returns a JSON string
This plugin allows some optoinal arguments following:
my %opt = ( slim => 1, slim_element_add => [ 'media:thumbnail@url' ], slim_element => [ 'link', 'title', 'pubDate' ], ); my $json = $feed->call( DumpJSON => %opt );
This plugin converts the whole feed into JSON format by default. All elements and attribuets are included in a JSON generated. If this boolean is true, some limited elements are only included.
An array reference for element/attribute names which is given by set()/get() method's format. These elements/attributes are also appended for slim JSON.
An array reference for element/attribute names. The default list of limited elements is replaced by this value.
XML::FeedPP, XML::TreePP and JSON::Syck
JSON, JavaScript Object Notation: http://www.json.org/
Yusuke Kawasaki, http://www.kawa.net/
Copyright (c) 2006-2008 Yusuke Kawasaki. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::FeedPP::Plugin::DumpJSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::FeedPP::Plugin::DumpJSON
CPAN shell
perl -MCPAN -e shell install XML::FeedPP::Plugin::DumpJSON
For more information on module installation, please visit the detailed CPAN module installation guide.