XML-Atom-SimpleFeed-0.900/000755 001750 000024 00000000000 12600245241 014625 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/Changes000644 001750 000024 00000014050 12600245241 016120 0ustar00apstaff000000 000000 Release history for XML-Atom-SimpleFeed 0.900 Tue 22 Sep 2015 - Support for arbitrary XML encodings [INCOMPATIBLE CHANGE] - Removal of ->no_generator method. To suppress the default generator tag, specify an undef generator. 0.863 Thu 10 Sep 2015 [INCOMPATIBLE CHANGE] - Datetime object support now via ->epoch method instead of ->strftime. Despite the fact that this is an incompatible change, it should actually be a non-event for almost all users, because every datetime module with a ->strftime method that I could find on CPAN also has an ->epoch method (as well as vice versa). However, the ->strftime methods of many modules are (subtly or badly) broken in the face of timezones, even as their ->epoch methods work right (or else are broken subtly enough to escape notice). But if you have written your own datetime class, and it has a ->strftime method but not an ->epoch method, and you pass an instance of your class to an instance of this module, then the feeds you generate that way will now be broken. On balance, I believe that this change will unbreak vastly more code than it breaks. Therefore I decided to switch. 0.862 Tue 08 Sep 2015 - Correct RFC 3339 formatting for datetime objects (Thanks, virii) 0.861 Tue 06 Jan 2015 - Auto-formatting for recognised data types in date constructs - Fixed CDATA flattener (was missing /s flag) - Non-fatal warnings; mea maxima culpa - Test suite cleanup - Now uses Dist::Zilla 0.86 Tue 23 Jun 2009 - Person constructs are properly escaped and encoded 0.85 Tue 23 Jun 2009 - Used a less finicky implementation strategy for the CDATA flattener so hopefully it will not be buggy any more 0.84 Tue 26 May 2009 - Added some basic XML writer tests, which uncovered a bug in the CDATA flattener, which is now fixed 0.83 Mon 25 May 2009 - Thanks to JMASTROS for spotting another bug in the XML escaping function and contributing a test case 0.82 Sat 21 Jun 2008 - I can't believe no one noticed in such a long time that the XML escaping function was broken. I need unit tests... - Also, the date in the changelog entry for 0.81 was wrong. 0.81 Sat 21 Jun 2008 - Put private functions in XML::Atom::SimpleFeed::YeWhoEnters and placed methods in XML::Atom::SimpleFeed explicitly. This gets rid of approximately 734 prefix underscores. - It turns out Carp::Clan wasn't even necessary, Carp works that way by default. *blush* - More big POD cleanups (converted lots of list items to subheadings so they're linkable and listed in the TOC). - Throw out the pointless POD and POD coverage tests. - Automatically escape the content of the `icon`, `id`, `logo`, `published`, and `updated` elements. Oops. (CPAN RT #36961) 0.8 Sat 03 Jun 2006 - Multiple consecutive internal refactors; code structure is now actually satisfactory - Handles multiple authors and contributors - Support for icon and logo elements - Big POD cleanup - Use Carp::Clean to get rid of silly $Carp::CarpLevel juggling - ***BACKWARDS INCOMPATIBLE API CHANGE***: Elements such as C which may appear multiple times are no longer specified in an anonymous array, but simply given repeatedly. - ***BACKWARDS INCOMPATIBLE API CHANGE***: Atom 0.3 element and attribute names are no longer supported. (No point keeping a lot of deprecation code around in the face of a change like the above.) - ***BACKWARDS INCOMPATIBLE API CHANGE***: Suppress the default C element requires calling the C method instead of passing a C key to C with an undefined value. - ***BACKWARDS INCOMPATIBLE API CHANGE***: Well, since I'm at it, the C method is no longer supported. C now takes a handle, though. - Cleaned up errors and warning messages and got rid of DIAGNOSTICS section in POD 0.8_004 Wed 10 May 2006 - Brownbag upload: forgot to update ./Changes in 0.8_003 0.8_003 Wed 10 May 2006 - Minor incremental progress; various bugfixes, some refactor. 0.8_002 Sun 09 Apr 2006 - Use builtin XML writer instead of SAX for output. This eliminates huge amounts of redundancy. - Big improvements in the distribution of responsibilities for deprecation and validation checks. - Array-based implementation rather than inside-out objects. - Internal structure is now more logical and consistent. 0.8_001 Wed 28 Sep 2005 - Emit Atom 1.0. Documentation updated to reflect Atom 1.0. Usage according to Atom 0.3 will transparently generate 1.0 elements but emit deprectation warnings. - Remove _generate_entry_id and use HTTP URLs as IDs by default. Using tag: URIs is useful for generating the ID once, up front, so that it won't change even if the permalink does -- if the ID is generated from the permalink, we might as well use the permalink directly. - Use XML::SAX::Writer instead of XML::Simple for output. 0.7 Fri 06 May 2005 - Fix the module prereq in Makefile.PL to actually do the proper dependency tests. Oops. 0.6 Wed 27 Apr 2005 - Use XML::Simple to generate the XML, instead of doing strings by hand. - Make the module more robust: it now can handle multiple titles, links, etc. by passing in arrayrefs and hashrefs, while still allowing for simple use with strings. - Many thanks to Aristotle Pagaltzis for the help. 0.5 Wed 09 Mar 2005 - Add an as_string method to return the feed as a scalar. - Escape any strings that appear in the content CDATA section. - Allow the save_file method to take either an open filehandle or a scalar containing a filename. - These issues reported by Aristotle Pagaltzis. 0.4 Tue 22 Feb 2005 - Rework the author code again to fixe more bugs that I probably should have caught before releasing 0.3. Sigh. 0.3 Tue 22 Feb 2005 - Fixed a bug in the entry author section where the author name was always showing up as "name". CPAN RT ID# 11620 - Fixed a similar bug in the feed-level author section. - Happy Birthday, Holly! 0.2 Sat 19 Feb 2005 - Adjust the XML encoding to produce valid feeds. 0.1 Fri 18 Feb 2005 - Initial release. XML-Atom-SimpleFeed-0.900/dist.ini000644 001750 000024 00000001262 12600245241 016272 0ustar00apstaff000000 000000 name = XML-Atom-SimpleFeed version = 0.900 author = Aristotle Pagaltzis license = Perl_5 copyright_holder = Aristotle Pagaltzis copyright_year = 2015 [MetaResources] homepage = http://github.com/ap/XML-Atom-SimpleFeed bugtracker = http://github.com/ap/XML-Atom-SimpleFeed/issues repository = git://github.com/ap/XML-Atom-SimpleFeed [@Filter] -bundle=@Basic -remove=Readme [Readme::Brief] [ReadmeAnyFromPod / PodInRoot] [MetaJSON] [PkgVersion] [PodWeaver] [CheckChangeLog] [Test::Compile] [AutoPrereqs] skip=^Test::LongString$ skip=^Time::Piece$ skip=^DateTime$ skip=^Time::Moment$ skip=^Panda::Date$ skip=^Class::Date$ skip=^Time::Object$ [CheckSelfDependency] XML-Atom-SimpleFeed-0.900/eg/000755 001750 000024 00000000000 12600245241 015220 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/lib/000755 001750 000024 00000000000 12600245241 015373 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/LICENSE000644 001750 000024 00000043700 12600245241 015636 0ustar00apstaff000000 000000 This software is copyright (c) 2015 by Aristotle Pagaltzis. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2015 by Aristotle Pagaltzis. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2015 by Aristotle Pagaltzis. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End XML-Atom-SimpleFeed-0.900/Makefile.PL000644 001750 000024 00000002554 12600245241 016605 0ustar00apstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.034. use strict; use warnings; use 5.008001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "No-fuss generation of Atom syndication feeds", "AUTHOR" => "Aristotle Pagaltzis ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "XML-Atom-SimpleFeed", "EXE_FILES" => [], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008001", "NAME" => "XML::Atom::SimpleFeed", "PREREQ_PM" => { "Carp" => 0, "Encode" => 0, "POSIX" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Find" => 0, "File::Temp" => 0, "Test::More" => "0.88", "utf8" => 0 }, "VERSION" => "0.900", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Encode" => 0, "ExtUtils::MakeMaker" => 0, "File::Find" => 0, "File::Temp" => 0, "POSIX" => 0, "Test::More" => "0.88", "strict" => 0, "utf8" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); XML-Atom-SimpleFeed-0.900/MANIFEST000644 001750 000024 00000000451 12600245241 015756 0ustar00apstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.034. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini eg/slackware-news lib/XML/Atom/SimpleFeed.pm t/00-compile.t t/bugs.t t/date_construct.t t/encodings.t t/generator.t t/synposis.t t/xml_writer.t XML-Atom-SimpleFeed-0.900/META.json000644 001750 000024 00000002476 12600245241 016257 0ustar00apstaff000000 000000 { "abstract" : "No-fuss generation of Atom syndication feeds", "author" : [ "Aristotle Pagaltzis " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.143240", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "XML-Atom-SimpleFeed", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Encode" : "0", "POSIX" : "0", "perl" : "5.008001", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Find" : "0", "File::Temp" : "0", "Test::More" : "0.88", "utf8" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://github.com/ap/XML-Atom-SimpleFeed/issues" }, "homepage" : "http://github.com/ap/XML-Atom-SimpleFeed", "repository" : { "type" : "git", "url" : "git://github.com/ap/XML-Atom-SimpleFeed" } }, "version" : "0.900" } XML-Atom-SimpleFeed-0.900/META.yml000644 001750 000024 00000001352 12600245241 016077 0ustar00apstaff000000 000000 --- abstract: 'No-fuss generation of Atom syndication feeds' author: - 'Aristotle Pagaltzis ' build_requires: File::Find: 0 File::Temp: 0 Test::More: 0.88 utf8: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: XML-Atom-SimpleFeed requires: Carp: 0 Encode: 0 POSIX: 0 perl: 5.008001 strict: 0 warnings: 0 resources: bugtracker: http://github.com/ap/XML-Atom-SimpleFeed/issues homepage: http://github.com/ap/XML-Atom-SimpleFeed repository: git://github.com/ap/XML-Atom-SimpleFeed version: 0.900 XML-Atom-SimpleFeed-0.900/README000644 001750 000024 00000001756 12600245241 015516 0ustar00apstaff000000 000000 XML::Atom::SimpleFeed This is a minimal API for generating Atom syndication feeds quickly and easily. It supports all aspects of the Atom format itself but has no mechanism for the inclusion of extension elements. You can supply strings for most things, and the module will provide useful defaults. When you want more control, you can provide data structures, as documented, to specify more particulars. INSTALLATION This is a Perl module distribution. It should be installed with whichever tool you use to manage your installation of Perl, e.g. any of cpanm . cpan . cpanp -i . Consult http://www.cpan.org/modules/INSTALL.html for further instruction. Should you wish to install this module manually, the procedure is perl Makefile.PL make make test make install COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Aristotle Pagaltzis. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. XML-Atom-SimpleFeed-0.900/t/000755 001750 000024 00000000000 12600245241 015070 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/t/00-compile.t000644 001750 000024 00000003125 12600245241 017123 0ustar00apstaff000000 000000 #!perl use strict; use warnings; use Test::More; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); sub _find_scripts { my $dir = shift @_; my @found_scripts = (); find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip open my $FH, '<', $_ or do { note( "Unable to open $found in ( $! ), skipping" ); return; }; my $shebang = <$FH>; return unless $shebang =~ /^#!.*?\bperl\b\s*$/; push @found_scripts, $found; }, $dir, ); return @found_scripts; } my @scripts; do { push @scripts, _find_scripts($_) if -d $_ } for qw{ bin script scripts }; my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } XML-Atom-SimpleFeed-0.900/t/bugs.t000644 001750 000024 00000000627 12600245241 016222 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; package XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing is person_construct( author => 'John Doe &' ), 'John Doe &', 'author names are escaped'; is person_construct( author => "John Doe \x{263A}" ), 'John Doe ☺', 'non-ASCII author names are encoded'; done_testing; XML-Atom-SimpleFeed-0.900/t/date_construct.t000644 001750 000024 00000004156 12600245241 020304 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; package XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing my $bigbang = '1970-01-01T00:00:00Z'; is date_construct( d => 0 ), $bigbang, 'correct RFC 3339 for Unix times'; SKIP: { skip 'missing Time::Piece', 1 unless eval { require Time::Piece }; is date_construct( d => Time::Piece->gmtime(0) ), $bigbang, 'correct RFC 3339 for Time::Piece objects'; is date_construct( d => Time::Piece->localtime(0) ), $bigbang, '... regardless of local timezone'; }; SKIP: { skip 'missing DateTime', 1 unless eval { require DateTime }; my @tz = ( time_zone => DateTime::TimeZone->new( name => 'local' ) ); is date_construct( d => DateTime->from_epoch( epoch => 0 ) ), $bigbang, 'correct RFC 3339 for DateTime objects'; is date_construct( d => DateTime->from_epoch( epoch => 0, @tz ) ), $bigbang, '... regardless of local timezone'; }; SKIP: { skip 'missing Time::Moment', 1 unless eval { require Time::Moment }; my $tm = Time::Moment->from_epoch(0); is date_construct( d => $tm ), $bigbang, 'correct RFC 3339 for Time::Moment objects'; $tm = $tm->with_offset_same_instant( Time::Moment->now->offset ); is date_construct( d => $tm ), $bigbang, '... regardless of local timezone'; }; SKIP: { skip 'missing Panda::Date', 1 unless eval { require Panda::Date }; is date_construct( d => Panda::Date->new(0, 'UTC') ), $bigbang, 'correct RFC 3339 for Class::Date objects'; is date_construct( d => Panda::Date->new(0) ), $bigbang, '... regardless of local timezone'; }; SKIP: { skip 'missing Class::Date', 1 unless eval { require Class::Date }; is date_construct( d => Class::Date::gmdate('00') ), $bigbang, 'correct RFC 3339 for Class::Date objects'; is date_construct( d => Class::Date::localdate('00') ), $bigbang, '... regardless of local timezone'; }; SKIP: { skip 'missing Time::Object', 1 unless eval { require Time::Object }; is date_construct( d => Time::Object::gmtime(0) ), $bigbang, 'correct RFC 3339 for Time::Object objects'; is date_construct( d => Time::Object::localtime(0) ), $bigbang, '... regardless of local timezone'; }; done_testing; XML-Atom-SimpleFeed-0.900/t/encodings.t000644 001750 000024 00000002101 12600245241 017220 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing BEGIN { eval { require Test::LongString; Test::LongString->import; 1 } or *is_string = \&is; } sub f { use utf8; XML::Atom::SimpleFeed->new( qw( title ß id € generator • updated 0 ), @_ )->as_string . "\n" } is_string f, <<"", 'us-ascii'; ß1970-01-01T00:00:00Z is_string f( -encoding => 'latin1' ), <<"", 'latin1'; \x{df}1970-01-01T00:00:00Z is_string f( -encoding => 'utf8' ), <<"", 'utf8'; \x{c3}\x{9f}\x{e2}\x{82}\x{ac}\x{e2}\x{80}\x{a2}1970-01-01T00:00:00Z done_testing; XML-Atom-SimpleFeed-0.900/t/generator.t000644 001750 000024 00000001147 12600245241 017246 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing my $g = XML::Atom::SimpleFeed::DEFAULT_GENERATOR; like $_, qr!$g->{'name'}!, 'default generator' for XML::Atom::SimpleFeed->new( qw( title x id y ) )->as_string; like $_, qr!z!, 'specified generator' for XML::Atom::SimpleFeed->new( qw( title x id y generator z ) )->as_string; unlike $_, qr!new( qw( title x id y generator ), undef )->as_string; done_testing; XML-Atom-SimpleFeed-0.900/t/synposis.t000644 001750 000024 00000003142 12600245241 017144 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing BEGIN { eval { require Test::LongString; Test::LongString->import; 1 } or *is_string = \&is; } my $g = XML::Atom::SimpleFeed::DEFAULT_GENERATOR; my $feed = XML::Atom::SimpleFeed->new( title => 'Example Feed', link => 'http://example.org/', link => { rel => 'self', href => 'http://example.org/atom', }, updated => '2003-12-13T18:30:02Z', author => 'John Doe', id => 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6', ); $feed->add_entry( title => 'Atom-Powered Robots Run Amok', link => 'http://example.org/2003/12/13/atom03', id => 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', summary => 'Some text.', updated => '2003-12-13T18:30:02Z', category => 'Atom', category => 'Miscellaneous', ); is_string $feed->as_string."\n", << "", 'synopsis code produces expected output'; Example Feed2003-12-13T18:30:02ZJohn Doeurn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6$g->{'name'}Atom-Powered Robots Run Amokurn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6aSome text.2003-12-13T18:30:02Z done_testing; XML-Atom-SimpleFeed-0.900/t/xml_writer.t000644 001750 000024 00000003521 12600245241 017452 0ustar00apstaff000000 000000 use strict; use warnings; use XML::Atom::SimpleFeed; package XML::Atom::SimpleFeed; use Test::More 0.88; # for done_testing BEGIN { eval { require Test::LongString; Test::LongString->import; 1 } or *is_string = \&is; } sub _ok { local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $fn, $in, $out, $desc ) = @_; is_string $fn->( $in ), $out, $desc; } _ok \&xml_escape, qq(<\x{FF34}\x{FF25}\x{FF33}\x{FF34} "&' d\xE3t\xE3>), qq(<TEST "&' dãtã>), 'XML tag content is properly encoded'; _ok sub { xml_encoding 'utf8', \&xml_escape, @_ }, qq(<\x{FF34}\x{FF25}\x{FF33}\x{FF34} "&' d\xE3t\xE3>), qq(<\x{ef}\x{bc}\x{b4}\x{ef}\x{bc}\x{a5}\x{ef}\x{bc}\x{b3}\x{ef}\x{bc}\x{b4} "&' d\x{c3}\x{a3}t\x{c3}\x{a3}>), '... even under other encodings'; _ok \&xml_attr_escape, qq(<\x{FF34}\x{FF25}\x{FF33}\x{FF34}\n"&'\rd\xE3t\xE3>), qq(<TEST "&' dãtã>), 'XML attribute content is properly encoded'; _ok sub { xml_encoding 'utf8', \&xml_attr_escape, @_ }, qq(<\x{FF34}\x{FF25}\x{FF33}\x{FF34}\n"&'\rd\xE3t\xE3>), qq(<\x{ef}\x{bc}\x{b4}\x{ef}\x{bc}\x{a5}\x{ef}\x{bc}\x{b3}\x{ef}\x{bc}\x{b4} "&' d\x{c3}\x{a3}t\x{c3}\x{a3}>), '... even under other encodings'; _ok \&xml_string, qq(Test ]]> sections), qq(Test <CDATA> sections), 'CDATA sections are properly flattened'; is xml_tag( 'br' ), '
', 'simple tags are self-closed'; is xml_tag( 'b', 'foo', '
' ), 'foo
', 'tags with content are properly formed'; is xml_tag( [ 'br', clear => 'left' ] ), '
', 'simple tags can have attributes'; is xml_tag( [ 'b', style => 'color: red' ], 'foo', '
' ), 'foo
', 'simple tags can have attributes'; done_testing; XML-Atom-SimpleFeed-0.900/lib/XML/000755 001750 000024 00000000000 12600245241 016033 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/lib/XML/Atom/000755 001750 000024 00000000000 12600245241 016733 5ustar00apstaff000000 000000 XML-Atom-SimpleFeed-0.900/lib/XML/Atom/SimpleFeed.pm000644 001750 000024 00000054316 12600245241 021317 0ustar00apstaff000000 000000 use 5.008001; # no good Unicode support? you lose use strict; use warnings; package XML::Atom::SimpleFeed; $XML::Atom::SimpleFeed::VERSION = '0.900'; # ABSTRACT: No-fuss generation of Atom syndication feeds use Carp; use Encode (); use POSIX (); my @XML_ENC = 'us-ascii'; # use array because local($myvar) error but local($myvar[0]) OK # and use a lexical because not a public interface sub ATOM_NS () { 'http://www.w3.org/2005/Atom' } sub XHTML_NS () { 'http://www.w3.org/1999/xhtml' } sub PREAMBLE () { qq(\n) } sub W3C_DATETIME () { '%Y-%m-%dT%H:%M:%S' } sub DEFAULT_GENERATOR () { { uri => 'https://metacpan.org/pod/' . __PACKAGE__, version => __PACKAGE__->VERSION || 'git', name => __PACKAGE__, } } #################################################################### # superminimal XML writer # sub xml_encoding { local $XML_ENC[0] = shift; &{(shift)} } my %XML_ESC = ( "\xA" => ' ', "\xD" => ' ', '"' => '"', '&' => '&', "'" => ''', '<' => '<', '>' => '>', ); sub xml_cref { Encode::encode $XML_ENC[0], $_[0], Encode::HTMLCREF } sub xml_escape { $_[0] =~ s{ ( [<>&'"] ) }{ $XML_ESC{ $1 } }gex; &xml_cref; } sub xml_attr_escape { $_[0] =~ s{ ( [\x0A\x0D<>&'"] ) }{ $XML_ESC{ $1 } }gex; &xml_cref; } sub xml_cdata_flatten { for ( $_[0] ) { my $cdata_content; s{}{ xml_escape $cdata_content = $1 }gse; croak 'Incomplete CDATA section' if -1 < index $_, '[ $i ] . '="' . xml_attr_escape( $name->[ $i + 1 ] ) . '"'; $i += 2; } $name = $name->[ 0 ]; } @_ ? join( '', "<$name$attr>", @_, "" ) : "<$name$attr/>"; } #################################################################### # misc utility functions # sub natural_enum { my @and; unshift @and, pop @_ if @_; unshift @and, join ', ', @_ if @_; join ' and ', @and; } sub permalink { my ( $link_arg ) = ( @_ ); if( ref $link_arg ne 'HASH' ) { return $link_arg; } elsif( not exists $link_arg->{ rel } or $link_arg->{ rel } eq 'alternate' ) { return $link_arg->{ href }; } return; } #################################################################### # actual implementation of RFC 4287 # sub simple_construct { my ( $name, $content ) = @_; xml_tag $name, xml_escape $content; } sub date_construct { my ( $name, $dt ) = @_; eval { $dt = $dt->epoch }; # convert to epoch to avoid dealing with everyone's TZ crap $dt = POSIX::strftime( W3C_DATETIME . 'Z', gmtime $dt ) unless $dt =~ /[^0-9]/; xml_tag $name, xml_escape $dt; } sub person_construct { my ( $name, $arg ) = @_; my $prop = 'HASH' ne ref $arg ? { name => $arg } : $arg; croak "name required for $name element" if not exists $prop->{ name }; return xml_tag $name => ( map { xml_tag $_ => xml_escape $prop->{ $_ } } grep { exists $prop->{ $_ } } qw( name email uri ) ); } sub text_construct { my ( $name, $arg ) = @_; my ( $type, $content ); if( ref $arg eq 'HASH' ) { # FIXME doesn't support @src attribute for $name eq 'content' yet $type = exists $arg->{ type } ? $arg->{ type } : 'html'; croak "content required for $name element" unless exists $arg->{ content }; # a lof of the effort that follows is to omit the type attribute whenever possible # if( $type eq 'xhtml' ) { $content = xml_string $arg->{ content }; if( $content !~ / xmlns => XHTML_NS ], $content; } } elsif( $type eq 'html' or $type eq 'text' ) { $content = xml_escape $arg->{ content }; } else { croak "type '$type' not allowed in $name element" if $name ne 'content'; # FIXME non-XML/text media types must be base64 encoded! $content = xml_string $arg->{ content }; } } else { $type = 'html'; $content = xml_escape $arg; } if( $type eq 'html' and $content !~ /&/ ) { $type = 'text'; $content =~ s/[\n\t]+/ /g; } return xml_tag [ $name => $type ne 'text' ? ( type => $type ) : () ], $content; } sub link_element { my ( $name, $arg ) = @_; # omit atom:link/@rel value when possible delete $arg->{'rel'} if 'HASH' eq ref $arg and exists $arg->{'rel'} and 'alternate' eq $arg->{'rel'}; my @attr = 'HASH' eq ref $arg ? do { croak "href required for link element" if not exists $arg->{'href'}; map { $_ => $arg->{ $_ } } grep exists $arg->{ $_ }, qw( href rel type title hreflang length ); } : ( href => $arg ); # croak "link '$attr[1]' is not a valid URI" # if $attr[1] XXX TODO xml_tag [ link => @attr ]; } sub category_element { my ( $name, $arg ) = @_; my @attr = 'HASH' eq ref $arg ? do { croak "term required for category element" if not exists $arg->{'term'}; map { $_ => $arg->{ $_ } } grep exists $arg->{ $_ }, qw( term scheme label ); } : ( term => $arg ); xml_tag [ category => @attr ]; } sub generator_element { my ( $name, $arg ) = @_; if( ref $arg eq 'HASH' ) { croak 'name required for generator element' if not exists $arg->{ name }; my $content = delete $arg->{ name }; xml_tag [ generator => map +( $_ => $arg->{ $_ } ), grep exists $arg->{ $_ }, qw( uri version ) ], xml_escape( $content ); } elsif( defined $arg ) { xml_tag generator => xml_escape( $arg ); } else { '' } } # tag makers are called with the name of the tag they're supposed to handle as the first parameter my %make_tag = ( icon => \&simple_construct, id => \&simple_construct, logo => \&simple_construct, published => \&date_construct, updated => \&date_construct, author => \&person_construct, contributor => \&person_construct, title => \&text_construct, subtitle => \&text_construct, rights => \&text_construct, summary => \&text_construct, content => \&text_construct, link => \&link_element, category => \&category_element, generator => \&generator_element, ); sub container_content { my ( $name, %arg ) = @_; my ( $elements, $required, $optional, $singular, $deprecation, $callback ) = @arg{ qw( elements required optional singular deprecate callback ) }; my ( $content, %permission, %count, $permalink ); undef @permission{ @$required, @$optional }; # populate while( my ( $elem, $arg ) = splice @$elements, 0, 2 ) { if( exists $permission{ $elem } ) { $content .= $make_tag{ $elem }->( $elem, $arg ); ++$count{ $elem }; } else { croak "Unknown element $elem"; } if( $elem eq 'link' and defined ( my $alt = permalink $arg ) ) { $permalink = $alt unless $count{ 'alternate link' }++; } if( exists $callback->{ $elem } ) { $callback->{ $elem }->( $arg ) } if( not @$elements ) { # end of input? # we would normally fall off the bottom of the loop now; # before that happens, it's time to defaultify stuff and # put it in the input so we will keep going for a little longer if( not $count{ id } and defined $permalink ) { carp 'Falling back to alternate link as id'; push @$elements, id => $permalink; } if( not $count{ updated } ) { push @$elements, updated => $arg{ default_upd }; } } } my @error; my @missing = grep { not exists $count{ $_ } } @$required; my @toomany = grep { ( $count{ $_ } || 0 ) > 1 } 'alternate link', @$singular; push @error, 'requires at least one ' . natural_enum( @missing ) . ' element' if @missing; push @error, 'must have no more than one ' . natural_enum( @toomany ) . ' element' if @toomany; croak $name, ' ', join ' and ', @error if @error; return $content; } #################################################################### # implementation of published interface and rest of RFC 4287 # sub XML::Atom::SimpleFeed::new { my $self = bless { xml_encoding => $XML_ENC[0] }, shift; if ( my @i = grep { '-encoding' eq $_[$_] } grep { not $_ % 2 } 0 .. $#_ ) { croak 'multiple encodings requested' if @i > 1; ( undef, my $encoding ) = splice @_, $i[0], 2; $self->{ xml_encoding } = $encoding; } @_ ? $self->feed( @_ ) : $self; } sub XML::Atom::SimpleFeed::feed { my $self = shift; my $have_generator; local $XML_ENC[0] = $self->{ xml_encoding }; $self->{ meta } = container_content feed => ( elements => \@_, required => [ qw( id title updated ) ], optional => [ qw( author category contributor generator icon logo link rights subtitle ) ], singular => [ qw( generator icon logo id rights subtitle title updated ) ], callback => { author => sub { $self->{ have_default_author } = 1 }, updated => sub { $self->{ global_updated } = $_[ 0 ] }, generator => sub { $have_generator = 1 }, }, default_upd => time, ); $self->{ meta } .= $make_tag{ generator }->( generator => DEFAULT_GENERATOR ) unless $have_generator; return $self; } sub XML::Atom::SimpleFeed::add_entry { my $self = shift; my @required = qw( id title updated ); my @optional = qw( category content contributor link published rights summary ); push @{ $self->{ have_default_author } ? \@optional : \@required }, 'author'; # FIXME # # o atom:entry elements that contain no child atom:content element # MUST contain at least one atom:link element with a rel attribute # value of "alternate". # # o atom:entry elements MUST contain an atom:summary element in either # of the following cases: # * the atom:entry contains an atom:content that has a "src" # attribute (and is thus empty). # * the atom:entry contains content that is encoded in Base64; # i.e., the "type" attribute of atom:content is a MIME media type # [MIMEREG], but is not an XML media type [RFC3023], does not # begin with "text/", and does not end with "/xml" or "+xml". local $XML_ENC[0] = $self->{ xml_encoding }; push @{ $self->{ entries } }, xml_tag entry => container_content entry => ( elements => \@_, required => \@required, optional => \@optional, singular => [ qw( content id published rights summary ) ], default_upd => $self->{ global_updated }, ); return $self; } sub XML::Atom::SimpleFeed::as_string { my $self = shift; local $XML_ENC[0] = $self->{ xml_encoding }; PREAMBLE . xml_tag [ feed => xmlns => ATOM_NS ], $self->{ meta }, @{ $self->{ entries } }; } sub XML::Atom::SimpleFeed::print { my $self = shift; my ( $handle ) = @_; local $, = local $\ = ''; defined $handle ? print $handle $self->as_string : print $self->as_string; } sub XML::Atom::SimpleFeed::save_file { croak q{no longer supported, use 'print' instead and pass in a filehandle} } !!'Funky and proud of it.'; __END__ =pod =encoding UTF-8 =head1 NAME XML::Atom::SimpleFeed - No-fuss generation of Atom syndication feeds =head1 VERSION version 0.900 =head1 SYNOPSIS use XML::Atom::SimpleFeed; my $feed = XML::Atom::SimpleFeed->new( title => 'Example Feed', link => 'http://example.org/', link => { rel => 'self', href => 'http://example.org/atom', }, updated => '2003-12-13T18:30:02Z', author => 'John Doe', id => 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6', ); $feed->add_entry( title => 'Atom-Powered Robots Run Amok', link => 'http://example.org/2003/12/13/atom03', id => 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', summary => 'Some text.', updated => '2003-12-13T18:30:02Z', category => 'Atom', category => 'Miscellaneous', ); $feed->print; =head1 DESCRIPTION This is a minimal API for generating Atom syndication feeds quickly and easily. It supports all aspects of the Atom format itself but has no mechanism for the inclusion of extension elements. You can supply strings for most things, and the module will provide useful defaults. When you want more control, you can provide data structures, as documented, to specify more particulars. =head1 INTERFACE =head2 C Takes a list of key-value pairs. Most keys are used to create corresponding L<"Atom elements"|/ATOM ELEMENTS>. To specify multiple instances of an element that may be given multiple times, pass multiple key-value pairs with the same key. Keys that start with a dash specify how the XML document will be generated. The following keys are supported: =over =item * C<-encoding> (I, default C) =item * L> (I) =item * L> (I, multiple) =item * L> (B) =item * L> (optional, multiple) =item * L> (optional, multiple) =item * L> (optional, multiple) =item * L> (optional) =item * L> (optional) =item * L> (optional) =item * L> (optional) =item * L> (optional) =item * L> (optional) =back =head2 C Takes a list of key-value pairs, used to create corresponding L<"Atom elements"|/ATOM ELEMENTS>. To specify multiple instances of an element that may be given multiple times, pass multiple key-value pairs with the same key. The following keys are supported: =over =item * L> (B unless there is a feed-level author, multiple) =item * L> (I) =item * L> (B, multiple) =item * L> (B) =item * L> (optional, multiple) =item * L> (optional) =item * L> (optional, multiple) =item * L> (optional) =item * L> (optional) =item * L> (optional) =item * L> (optional) =back =head2 C Returns the XML representation of the feed as a string. =head2 C Outputs the XML representation of the feed to a handle which should be passed as a parameter. Defaults to C if you do not pass a handle. =head1 ATOM ELEMENTS =head2 C A L denoting the author of the feed or entry. If you supply at least one author for the feed, you can omit this information from entries; the feed's author(s) will be assumed as the author(s) for those entries. If you do not supply any author for the feed, you B supply one for each entry. =head2 C One or more categories that apply to the feed or entry. You can supply a string which will be used as the category term. The full range of details that can be provided by passing a hash instead of a string is as follows: =over =item C (B) The category term. =item C (optional) A URI that identifies a categorization scheme. It is common to provide the base of some kind of by-category URL here. F.ex., if the weblog C can be browsed by category using URLs such as C, you would supply C as the scheme and, in that case, C as the term. =item C