Create opml using xml::simple
version 0.07
require XML::OPML::SimpleGen; my $opml = new XML::OPML::SimpleGen(); $opml->head( title => 'FIFFS Subscriptions', ); $opml->insert_outline( group => 'news', # groups will be auto generated text => 'some feed', xmlUrl => 'http://www.somepage.org/feed.xml', ); # insert_outline and add_outline are the same $opml->add_group( text => 'myGroup' ); # explicitly create groups print $opml->to_string; $opml->save('somefile.opml'); $opml->xml_options( $hashref ); # XML::Simple compatible options # See XML::OPML's synopsis for more knowledge
XML::OPML::SimpleGen lets you simply generate \s-1OPML\s0 documents without having too much to worry about. It is a drop-in replacement for \s-1XML::OPML\s0 in regards of generation. As this module uses XML::Simple it is rather generous in regards of attribute or element names.
Creates a new XML::OPML::SimpleGen instance. All key values will be used as attributes for the <atom> element. The only thing you might want to use here is the version => '1.1', which is default anyway.
\s-1XML::OPML\s0 compatible head method to change header values.
Returns (and increments) a counter.
Method to explicitly create a group which can hold multiple outline elements.
\s-1XML::OPML\s0 compatible method to add an outline element. See \s-1XML::OPML\s0 for details. The group key is used to put elements in a certain group. Non existent groups will be created automagically.
Alias to insert_outline for \s-1XML::OPML\s0 compatibility.
Returns the given \s-1OPML\s0 \s-1XML\s0 data as a string Saves the \s-1OPML\s0 data to a file
$hashref may contain any XML::Simple options. The outline method defines the 'template' for any new outline element. You can preset key value pairs here to be used in all outline elements that will be generated by XML::OPML::SimpleGen. This method is similar to outline, it defines the template for a grouping outline element.
Stephen Cardie \*(C`<[email protected]>\*(C'
https://github.com/stephenca/XML-OPML-SimpleGen <https://github.com/stephenca/XML-OPML-SimpleGen>
The git repository for this module is at L<https://github.com/stephenca/XML-OPML-SimpleGen>
Please report any bugs or feature requests to \*(C`[email protected]\*(C', or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-OPML-SimleGen <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-OPML-SimleGen>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
\s-1XML::OPML\s0 XML::Simple
Marcus Theisen <[email protected]>
This software is copyright (c) 2013 by Marcus Thiesen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.