libxml-feed-perl-0.53+dfsg.orig/0000755000175000017500000000000012634070640015743 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/MANIFEST0000444000175000017500000000300412634070640017067 0ustar gregoagregoaBuild.PL Makefile.PL Changes eg/check_feed.pl lib/XML/Feed.pm lib/XML/Feed/Content.pm lib/XML/Feed/Enclosure.pm lib/XML/Feed/Entry.pm lib/XML/Feed/Entry/Format/Atom.pm lib/XML/Feed/Entry/Format/RSS.pm lib/XML/Feed/Format/Atom.pm lib/XML/Feed/Format/RSS.pm MANIFEST This list of files MANIFEST.SKIP META.json META.yml README t/00-compile.t t/01-parse.t t/02-create.t t/04-splice-atom.t t/04-splice-rss.t t/05-atom10-link.t t/06-atom10.t t/07-atom10-create.t t/08-convert-summary-bug.t t/09-missing-content-bug.t t/10-mix-and-match.t t/11-xml-base-atom.t t/11-xml-base-rss.t t/12-multi-categories-atom.t t/12-multi-categories-rss.t t/12-multi-categories.base t/12-multi-subjects-rss.t t/13-category-hash-bug.t t/14-enclosures.t t/14-multi-enclosures.t t/15-odd-date.t t/16-convert-mult-categories.t t/17-double.t t/18-double2.t t/19-double3.t t/20-no-enclosures.t t/21-rss2-permalinks.t t/22-bug73160.t t/23-eval.t t/pod-coverage.t t/pod.t t/samples/atom-10-example.xml t/samples/atom-enclosure.xml t/samples/atom-full.xml t/samples/atom-multi-enclosure.xml t/samples/atom-multiple-categories.xml t/samples/atom.xml t/samples/base_atom.xml t/samples/base_rss.xml t/samples/rss-multiple-categories.xml t/samples/rss-multiple-subjects.xml t/samples/rss10-double.xml t/samples/rss10-double2.xml t/samples/rss10-invalid-date.xml t/samples/rss10-odd-date.xml t/samples/rss10.xml t/samples/rss20-double.xml t/samples/rss20-enclosure.xml t/samples/rss20-multi-enclosure.xml t/samples/rss20-no-summary.xml t/samples/rss20-p.xml t/samples/rss20.xml libxml-feed-perl-0.53+dfsg.orig/Changes0000444000175000017500000006702212633540754017252 0ustar gregoagregoa------------------------------------------------------------------- Mon Dec 14 11:14:09 CET 2015 - dave@dave.org.uk - Bump versions for release. - commit c4d9cd4 ------------------------------------------------------------------- Sat Nov 28 10:18:08 CET 2015 - zhouzhen1@gmail.com - add URI to build_requires in Build.PL - commit c65330d ------------------------------------------------------------------- Sat Jul 18 13:10:39 CEST 2015 - dave@dave.org.uk - Updated .travis.yml - commit fe4e5e6 ------------------------------------------------------------------- Wed Jan 28 16:48:34 CET 2015 - ribugent@gmail.com - Fix lib/XML/Feed/Entry/Format/RSS.pm crash - commit b6f39ae ------------------------------------------------------------------- Thu Oct 16 06:54:55 CEST 2014 - ether@cpan.org - avoid deprecated form of isa() - commit cf84451 ------------------------------------------------------------------- Mon Jun 16 10:06:51 CEST 2014 - gabor@szabgab.com - utf8 encoding in helper script - commit a51d4e2 ------------------------------------------------------------------- Tue Feb 4 19:16:03 CET 2014 - x.github@chatterjee.net - Fixed minor typo in docs ("obhect" -> "object") - commit 80b293c ------------------------------------------------------------------- Fri Jan 10 15:10:53 CET 2014 - dave@dave.org.uk - Added .travis.yml - commit f3f9a3f ------------------------------------------------------------------- Tue Mar 19 09:22:25 CET 2013 - szabgab@gmail.com - add Minty to list of contributors - commit 3998e48 ------------------------------------------------------------------- Tue Mar 19 09:20:09 CET 2013 - szabgab@gmail.com - calculate plan from examples - commit c45da65 ------------------------------------------------------------------- Tue Mar 19 00:03:13 CET 2013 - murray@minty.org - Fix pod example usage for identify_format : it takes a scalar ref - commit b86b614 ------------------------------------------------------------------- Tue Mar 19 00:00:40 CET 2013 - murray@minty.org - Add test for XML::Feed->identify_format() - commit 09698b3 ------------------------------------------------------------------- Tue Feb 26 20:51:08 CET 2013 - szabgab@gmail.com - add dist_author and x_contributors to META files - commit 69c2ffa ------------------------------------------------------------------- Tue Feb 26 20:50:17 CET 2013 - szabgab@gmail.com - ignore some generated files - commit 4ab99d5 ------------------------------------------------------------------- Tue Jan 8 10:31:35 CET 2013 - szabgab@gmail.com - add use warnings to the modules - commit fb2ed13 ------------------------------------------------------------------- Tue Jan 8 10:29:46 CET 2013 - szabgab@gmail.com - remove Id tags from the times of Subversion - commit b6ca9a5 ------------------------------------------------------------------- Tue Jan 8 10:27:03 CET 2013 - szabgab@gmail.com - add version number to all the modules - commit c569ee9 ------------------------------------------------------------------- Fri Jan 4 07:47:06 CET 2013 - dave@dave.org.uk - Bump version for release - commit 43f0427 ------------------------------------------------------------------- Fri Jan 4 07:45:09 CET 2013 - dave@dave.org.uk - Commit changes to Changes - commit 8a1d6c9 ------------------------------------------------------------------- Sun Dec 30 21:48:13 CET 2012 - szabgab@gmail.com - change the User Agent string - commit eeff6c3 ------------------------------------------------------------------- Sat Jul 28 16:43:02 CEST 2012 - shlomif@shlomifish.org - Add a meta_merge link to the respository. This way metacpan.org and other services will display it. - commit b7913ac ------------------------------------------------------------------- Tue Jul 10 22:17:33 CEST 2012 - dave@dave.org.uk - Bump version for release. - commit dfeacbf ------------------------------------------------------------------- Tue Jul 10 22:16:12 CEST 2012 - dave@dave.org.uk - Added an image() method to Feed objects. Does something useful for RSS feeds; not for Atom feeds currently. - commit f251264 ------------------------------------------------------------------- Tue Jul 10 22:08:49 CEST 2012 - dave@dave.org.uk - Fixed tests - commit fe6cfa8 ------------------------------------------------------------------- Tue Apr 10 15:19:49 CEST 2012 - voss@gbv.de - Add support for RFC 5005 Feed Paging and Archiving in Atom feeds - commit 02de179 ------------------------------------------------------------------- Fri Apr 6 18:02:11 CEST 2012 - dave@dave.org.uk - Bump version for release. - commit e46a668 ------------------------------------------------------------------- Thu Apr 5 16:51:49 CEST 2012 - dave@dave.org.uk - Remove svn tag. - commit ad4da28 ------------------------------------------------------------------- Thu Apr 5 16:48:54 CEST 2012 - dave@dave.org.uk - Changed contact details from non-working 6A email address. - commit e933a73 ------------------------------------------------------------------- Wed Mar 28 06:27:55 CEST 2012 - wes.sheldahl@gmail.com - Updated README file with current and tested installation instructions. Hoping to clarify the confusion reflected in RT # 53884, maybe even resolve it. https://rt.cpan.org/Public/Bug/Display.html?id=53884 - commit 6ab3d29 ------------------------------------------------------------------- Mon Mar 12 20:49:31 CET 2012 - dave@dave.org.uk - Bump version for release. - commit 6c0ab45 ------------------------------------------------------------------- Mon Mar 12 20:39:46 CET 2012 - dave@dave.org.uk - Fixed broken date test. - commit fb5c190 ------------------------------------------------------------------- Mon Mar 12 15:36:45 CET 2012 - dave@dave.org.uk - Applying the missing bit of the patch from https://rt.cpan.org/Ticket/Display.html?id=20763 - commit bee3178 ------------------------------------------------------------------- Sat Mar 10 15:56:43 CET 2012 - dave@dave.org.uk - Bump version number for release. - commit f8b9d33 ------------------------------------------------------------------- Sat Mar 10 15:55:12 CET 2012 - dave@dave.org.uk - Increase XML::Atom dependency to 0.37 - see https://rt.cpan.org/Ticket/Display.html?id=74703 - commit 4e9cef3 ------------------------------------------------------------------- Tue Mar 6 11:21:01 CET 2012 - szabgab@gmail.com - fix MANIFEST.SKIP - commit 266eef5 ------------------------------------------------------------------- Tue Mar 6 11:19:39 CET 2012 - szabgab@gmail.com - update MANIFEST file - commit 1a4ab1c ------------------------------------------------------------------- Tue Mar 6 10:57:19 CET 2012 - szabgab@gmail.com - add example - commit 4fd4f90 ------------------------------------------------------------------- Tue Mar 6 10:26:07 CET 2012 - szabgab@gmail.com - add links to the POD - commit 200ce86 ------------------------------------------------------------------- Sun Feb 19 08:52:00 CET 2012 - szabgab@gmail.com - add explicit tests for loading internal packages and failing when it does not exist - commit e3322e1 ------------------------------------------------------------------- Sun Feb 19 08:26:03 CET 2012 - szabgab@gmail.com - split up files to individual packages - commit 8c43fc5 ------------------------------------------------------------------- Sun Feb 19 08:25:23 CET 2012 - szabgab@gmail.com - ignore *.swp files - commit b596637 ------------------------------------------------------------------- Sat Feb 18 19:43:51 CET 2012 - szabgab@gmail.com - gitignore some generated files - commit 5522012 ------------------------------------------------------------------- Fri Feb 17 12:32:12 CET 2012 - szabgab@gmail.com - add missing return call fixing the failures introduced when trying to fix 73160 - commit f9cc521 ------------------------------------------------------------------- Fri Feb 17 12:05:43 CET 2012 - szabgab@gmail.com - eliminate warning generated in t/16-convert-mult-categories.t - commit 3b96974 ------------------------------------------------------------------- Sun Dec 11 13:47:52 CET 2011 - dave@dave.org.uk - Added tests for bug 73160. And code to make them pass. - commit 710ed82 ------------------------------------------------------------------- Sat Sep 3 12:58:59 CEST 2011 - dave@dave.org.uk - Updated changed for 0.45 (oops) and 0.46. - commit 039dfec ------------------------------------------------------------------- Sat Sep 3 12:53:34 CEST 2011 - dave@dave.org.uk - Closed a few tickets from the RT queue as an excuse for a new release. Bumped to version 0.46. - commit 7b5fccb ------------------------------------------------------------------- Sat Jul 30 13:30:16 CEST 2011 - dave@dave.org.uk - Another round of changes to fix (and test) https://rt.cpan.org/Public/Bug/Display.html?id=44899 - commit f4278e1 ------------------------------------------------------------------- Sat Jul 16 18:03:27 CEST 2011 - dave@dave.org.uk - Added new (currently failing) test for the double-encoding bug. - commit 89495df ------------------------------------------------------------------- Sun Apr 24 16:07:53 CEST 2011 - dave@dave.org.uk - Tests to ensure that the double-encoding bug fix works. - commit cb30c63 ------------------------------------------------------------------- Sun Mar 13 11:20:11 CET 2011 - dave@dave.org.uk - Added new tests to prove what the problem is. - commit b0d119a ------------------------------------------------------------------- Sun Mar 13 11:08:10 CET 2011 - dave@dave.org.uk - Force stringification so test passes. - commit 1809011 ------------------------------------------------------------------- Mon Mar 22 22:07:55 CET 2010 - simon@thegestalt.org - Force requiring HTML::Entities; - commit 6f2c899 ------------------------------------------------------------------- Mon Mar 22 22:04:05 CET 2010 - simon@thegestalt.org - Fix bug in conversion process between RSS and Atom where HTML got double encoded https://rt.cpan.org/Public/Bug/Display.html?id=44899 - commit 934ef9a ------------------------------------------------------------------- Mon Mar 22 21:50:41 CET 2010 - simon@thegestalt.org - Fix double encoding bug? - commit b7c406f ------------------------------------------------------------------- Mon Mar 22 21:50:20 CET 2010 - simon@thegestalt.org - Add updated() - commit e23387f ------------------------------------------------------------------- Tue Nov 17 03:00:00 CET 2009 - simon@thegestalt.org - Fix a problem converting multiple categories thanks to Алексей Капранов (KAPPA) in bug 50125 https://rt.cpan.org/Ticket/Display.html?id=50125 - commit ff32fd5 ------------------------------------------------------------------- Tue Nov 17 02:50:53 CET 2009 - simon@thegestalt.org - Fixing RT #47981 https://rt.cpan.org/Ticket/Display.html?id=47981 Which is due to Blogspot using unusual atom namespaced elements in short RSS feeds. - commit 723eaa1 ------------------------------------------------------------------- Tue Nov 17 02:17:55 CET 2009 - simon@thegestalt.org - Add Build.PL - commit 7f58a36 ------------------------------------------------------------------- Fri May 29 23:19:14 CEST 2009 - simon@thegestalt.org - Fix buglet to do with odd date terms https://rt.cpan.org/Ticket/Display.html?id=46494 (Joey Hess) - commit daba724 ------------------------------------------------------------------- Fri May 29 23:17:05 CEST 2009 - simon@thegestalt.org - Add Makefile.PL - commit d83c0d6 ------------------------------------------------------------------- Thu May 7 02:47:58 CEST 2009 - simon@thegestalt.org - Multiple enclosure support - commit b1aa7a6 ------------------------------------------------------------------- Fri Apr 3 17:16:38 CEST 2009 - simon@thegestalt.org - Merge changes - commit 3e19dc0 ------------------------------------------------------------------- Fri Apr 3 17:16:10 CEST 2009 - simon@thegestalt.org - Add a note about XML::RSS::LibXML - commit 0c20159 ------------------------------------------------------------------- Sun Jan 25 13:44:25 CET 2009 - miyagawa@bulknews.net - docs - commit 75c12aa ------------------------------------------------------------------- Sun Jan 25 13:42:08 CET 2009 - miyagawa@bulknews.net - Fixed RSS multiple category with XML::RSS::LibXML - commit e5a65e5 ------------------------------------------------------------------- Thu Dec 11 02:55:52 CET 2008 - simon@thegestalt.org - First cut at enclosures - commit 12a4079 ------------------------------------------------------------------- Wed Dec 10 21:27:46 CET 2008 - simon@thegestalt.org - GAH - commit f658a3b ------------------------------------------------------------------- Wed Dec 10 21:26:41 CET 2008 - simon@thegestalt.org - Whoops again - commit 1c6eb9b ------------------------------------------------------------------- Wed Dec 10 21:26:14 CET 2008 - simon@thegestalt.org - Whoops - commit ea0ac06 ------------------------------------------------------------------- Wed Dec 10 21:15:44 CET 2008 - simon@thegestalt.org - Gte ready for release - commit a759e13 ------------------------------------------------------------------- Wed Dec 10 00:48:16 CET 2008 - simon@thegestalt.org - Fix bug with adding first category - commit 4eb9395 ------------------------------------------------------------------- Wed Dec 10 00:39:29 CET 2008 - simon@thegestalt.org - First cut at multiple category/tag support - commit a0cca2a ------------------------------------------------------------------- Mon Dec 1 22:17:51 CET 2008 - simon@thegestalt.org - Set Id keyword on everything - commit 3353d70 ------------------------------------------------------------------- Mon Nov 24 01:59:24 CET 2008 - simon@thegestalt.org - First cut at enclosure support - commit aa2dcd5 ------------------------------------------------------------------- Mon Nov 24 01:47:26 CET 2008 - simon@thegestalt.org - Add enclosure code. - commit af6b00a ------------------------------------------------------------------- Mon Nov 24 01:43:50 CET 2008 - simon@thegestalt.org - Update property - commit f376357 ------------------------------------------------------------------- Fri Nov 21 21:41:06 CET 2008 - simon@thegestalt.org - UTF8 problem - commit 4c07283 ------------------------------------------------------------------- Fri Nov 21 21:37:23 CET 2008 - simon@thegestalt.org - Fix Andreas' name - commit c022ef2 ------------------------------------------------------------------- Fri Nov 21 02:18:35 CET 2008 - simon@thegestalt.org - Fix base support with latest version of XML::RSS - commit f62087b ------------------------------------------------------------------- Sat Nov 15 00:24:55 CET 2008 - simon@thegestalt.org - Add bug fix - commit c56795e ------------------------------------------------------------------- Fri Nov 14 23:10:05 CET 2008 - simon@thegestalt.org - Add version to Entry - commit 3bdbab6 ------------------------------------------------------------------- Fri Nov 14 23:05:54 CET 2008 - simon@thegestalt.org - Fix 'base' stuff - commit 4ad1301 ------------------------------------------------------------------- Tue Nov 11 19:17:25 CET 2008 - simon@thegestalt.org - Add Build.PL - commit 4c06eb3 ------------------------------------------------------------------- Tue Nov 4 23:09:14 CET 2008 - simon@thegestalt.org - Add date into Changes - commit e73bcbb ------------------------------------------------------------------- Tue Nov 4 23:07:39 CET 2008 - simon@thegestalt.org - Cleanup - commit bd19b44 ------------------------------------------------------------------- Tue Nov 4 06:42:53 CET 2008 - simon@thegestalt.org - Update for new status - commit 1ae2598 ------------------------------------------------------------------- Tue Nov 4 01:02:05 CET 2008 - simon@thegestalt.org - Add note about https://rt.cpan.org/Ticket/Display.html?id=14725 - commit 60c04bc ------------------------------------------------------------------- Tue Nov 4 00:54:28 CET 2008 - simon@thegestalt.org - Move to the Formats identifying what content to look at - commit 9b6bc91 ------------------------------------------------------------------- Tue Nov 4 00:53:48 CET 2008 - simon@thegestalt.org - Update tests - commit 4e7b539 ------------------------------------------------------------------- Tue Nov 4 00:48:51 CET 2008 - simon@thegestalt.org - Add pod*.t - commit 72406e4 ------------------------------------------------------------------- Tue Nov 4 00:47:42 CET 2008 - simon@thegestalt.org - Rollback r92 - commit 1d3481d ------------------------------------------------------------------- Tue Nov 4 00:43:32 CET 2008 - simon@thegestalt.org - Update tests - commit 948f935 ------------------------------------------------------------------- Tue Nov 4 00:18:05 CET 2008 - simon@thegestalt.org - Switch to different layout - commit 729cd7a ------------------------------------------------------------------- Wed Oct 29 18:55:22 CET 2008 - simon@thegestalt.org - Add pod and coverage tests - commit 8c30ad3 ------------------------------------------------------------------- Fri Oct 24 20:54:39 CEST 2008 - simon@thegestalt.org - Add note about makign a validating URL - commit b8bc97f ------------------------------------------------------------------- Fri Oct 24 03:40:26 CEST 2008 - simon@thegestalt.org - Add date - commit 0d3e3b6 ------------------------------------------------------------------- Fri Oct 24 03:39:56 CEST 2008 - simon@thegestalt.org - Update MANIFEST file with new tests - commit bb5f785 ------------------------------------------------------------------- Fri Oct 24 03:37:54 CEST 2008 - simon@thegestalt.org - Up the version number - commit 5cc6e23 ------------------------------------------------------------------- Fri Oct 24 01:39:56 CEST 2008 - simon@thegestalt.org - Add xml:base work - commit a0793d5 ------------------------------------------------------------------- Fri Oct 24 01:32:52 CEST 2008 - simon@thegestalt.org - Fix typo - commit 0f71bfb ------------------------------------------------------------------- Fri Oct 24 01:30:32 CEST 2008 - simon@thegestalt.org - Update xml:base parsing in RSS - commit e3b96b9 ------------------------------------------------------------------- Fri Oct 24 00:43:52 CEST 2008 - simon@thegestalt.org - Make base work - commit 7c89fff ------------------------------------------------------------------- Thu Oct 23 02:45:43 CEST 2008 - simon@thegestalt.org - Initiali support for xml:base - commit 5383a56 ------------------------------------------------------------------- Thu Oct 23 02:45:12 CEST 2008 - simon@thegestalt.org - Misnamed - commit d653dd2 ------------------------------------------------------------------- Thu Oct 23 01:44:24 CEST 2008 - simon@thegestalt.org - Fix mixing and matching of RSS and Atom - commit 33d4cb3 ------------------------------------------------------------------- Wed Oct 22 22:48:19 CEST 2008 - simon@thegestalt.org - Up version - commit f33453c ------------------------------------------------------------------- Wed Oct 22 22:46:18 CEST 2008 - simon@thegestalt.org - Fix fetching through proxies - commit d39809a ------------------------------------------------------------------- Wed Oct 22 22:41:42 CEST 2008 - simon@thegestalt.org - Add support for self linking and GeoRSS Patches from Shlomi Fish http://rt.cpan.org/Ticket/Display.html?id=39924 and Scott Gifford http://rt.cpan.org/Ticket/Display.html?id=40046 - commit 9a36f82 ------------------------------------------------------------------- Wed Oct 22 21:10:08 CEST 2008 - simon@thegestalt.org - Make feed validate - commit 813f78d ------------------------------------------------------------------- Thu Oct 16 21:20:49 CEST 2008 - simon@thegestalt.org - Created test for http://rt.cpan.org/Ticket/Display.html?id=18810 (Ryan Tate) - commit 5b3d39d ------------------------------------------------------------------- Thu Oct 16 21:13:07 CEST 2008 - simon@thegestalt.org - Up the minimum requirement for XML::RSS to 1.31 http://rt.cpan.org/Ticket/Display.html?id=23588 (Andreas König ANDK) - commit 1570cde ------------------------------------------------------------------- Thu Oct 16 21:02:10 CEST 2008 - simon@thegestalt.org - Correct namespace for terms in RSS http://rt.cpan.org/Ticket/Display.html?id=25393 (Kent Cowgill KCOWGILL) - commit af62770 ------------------------------------------------------------------- Wed Oct 15 20:11:12 CEST 2008 - simon@thegestalt.org - Get rid of the inc directory - commit 632e163 ------------------------------------------------------------------- Wed Oct 15 20:04:55 CEST 2008 - simon@thegestalt.org - Force a non-segfaulting version of XML::LibXML - commit 457482d ------------------------------------------------------------------- Wed Oct 15 19:55:29 CEST 2008 - simon@thegestalt.org - Shush - commit aeec183 ------------------------------------------------------------------- Wed Oct 15 19:53:48 CEST 2008 - simon@thegestalt.org - Add a note as to where to find this in subversion - commit 70f935c ------------------------------------------------------------------- Wed Oct 15 19:53:31 CEST 2008 - simon@thegestalt.org - Force stringification - commit a91dfb9 ------------------------------------------------------------------- Wed Oct 15 19:16:01 CEST 2008 - simon@thegestalt.org - Add keywords - commit efef760 ------------------------------------------------------------------- Fri Oct 3 21:18:01 CEST 2008 - simon@thegestalt.org - Fix broken summary behaviour - commit ac9492d ------------------------------------------------------------------- Thu Oct 2 00:24:30 CEST 2008 - simon@thegestalt.org - Feed fixes - commit 4f41343 ------------------------------------------------------------------- Wed Oct 1 02:16:42 CEST 2008 - simon@thegestalt.org - Fix encoding problems - commit ccc9fe4 ------------------------------------------------------------------- Sat Aug 23 00:48:46 CEST 2008 - simon@thegestalt.org - Shush - commit 43a7504 ------------------------------------------------------------------- Sat Aug 23 00:48:24 CEST 2008 - simon@thegestalt.org - Checking for conversion bug - commit f7c452e ------------------------------------------------------------------- Sat Aug 23 00:48:03 CEST 2008 - simon@thegestalt.org - Generated files shouldn't be in SVN - commit a3b2ba1 ------------------------------------------------------------------- Sat Aug 23 00:46:23 CEST 2008 - simon@thegestalt.org - Note the switch to module::build - commit f9e32c8 ------------------------------------------------------------------- Sat Aug 23 00:39:30 CEST 2008 - simon@thegestalt.org - Switch to Module::Build - commit bfcc8cf ------------------------------------------------------------------- Sat Aug 23 00:29:40 CEST 2008 - simon@thegestalt.org - Update version - commit f422a85 ------------------------------------------------------------------- Sat Aug 23 00:29:19 CEST 2008 - simon@thegestalt.org - use wantarray for backwards compatability - commit bf34c07 ------------------------------------------------------------------- Sat Aug 23 00:29:04 CEST 2008 - simon@thegestalt.org - Need to actually pick up the format. Doh - commit 0c81cb2 ------------------------------------------------------------------- Sat Aug 23 00:17:32 CEST 2008 - simon@thegestalt.org - Cope with "updated" and "published" elements http://rt.cpan.org/Public/Bug/Display.html?id=20763 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=380498 (Gregor Herrmann and Joey Hess) - commit 1ee56ab ------------------------------------------------------------------- Sat Aug 23 00:07:29 CEST 2008 - simon@thegestalt.org - Prevent empty content http://rt.cpan.org/Public/Bug/Display.html?id=29684 (Dave Rolsky DROLSKY) - commit 566afdf ------------------------------------------------------------------- Fri Aug 22 23:52:12 CEST 2008 - simon@thegestalt.org - Allow accessors to make sure things validate - commit e8fcbc5 ------------------------------------------------------------------- Fri Aug 22 21:56:17 CEST 2008 - simon@thegestalt.org - Force working version XML::Atom http://rt.cpan.org/Public/Bug/Display.html?id=22548 http://rt.cpan.org/Public/Bug/Display.html?id=19920 - commit 4b70ec2 ------------------------------------------------------------------- Fri Aug 22 21:54:30 CEST 2008 - simon@thegestalt.org - Allow passing through of initialisation options. http://rt.cpan.org/Public/Bug/Display.html?id=24729 - commit 4e9c462 ------------------------------------------------------------------- Fri Aug 22 21:39:09 CEST 2008 - simon@thegestalt.org - Allow specification of the parsing format. Fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477394 - commit 41e8c13 ------------------------------------------------------------------- Thu Aug 21 22:00:37 CEST 2008 - simon@thegestalt.org - Wrong place for this - commit 633cb45 ------------------------------------------------------------------- Thu Aug 21 21:24:54 CEST 2008 - simon@thegestalt.org - No rpm, no cpan, no svn so we include it here - commit bfd6c84 ------------------------------------------------------------------- Tue Apr 22 20:01:00 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.12 into trunk. - commit c4d4c98 ------------------------------------------------------------------- Tue Apr 22 20:00:55 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.11 into trunk. - commit 4679cf3 ------------------------------------------------------------------- Tue Apr 22 20:00:51 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.10 into trunk. - commit 4f6ca99 ------------------------------------------------------------------- Tue Apr 22 20:00:46 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.09 into trunk. - commit fe3b320 ------------------------------------------------------------------- Tue Apr 22 20:00:40 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.08 into trunk. - commit ecac864 ------------------------------------------------------------------- Tue Apr 22 20:00:37 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.07 into trunk. - commit 2310317 ------------------------------------------------------------------- Tue Apr 22 20:00:32 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.06 into trunk. - commit 973e1f9 ------------------------------------------------------------------- Tue Apr 22 20:00:28 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.05 into trunk. - commit b3b6d2f ------------------------------------------------------------------- Tue Apr 22 20:00:22 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.04 into trunk. - commit fe71566 ------------------------------------------------------------------- Tue Apr 22 20:00:17 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.03 into trunk. - commit 62d9277 ------------------------------------------------------------------- Tue Apr 22 20:00:14 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.02 into trunk. - commit a749d9b ------------------------------------------------------------------- Tue Apr 22 20:00:06 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.01 into trunk. - commit 0d5e38d ------------------------------------------------------------------- Tue Apr 22 19:49:25 CEST 2008 - simon@thegestalt.org - Make - commit 0583180 ------------------------------------------------------------------- Tue Apr 22 19:48:48 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.01 into trunk. - commit 5ec68b3 ------------------------------------------------------------------- Tue Apr 22 19:48:07 CEST 2008 - simon@thegestalt.org - Create - commit 535e50d ------------------------------------------------------------------- Tue Apr 22 19:46:42 CEST 2008 - simon@thegestalt.org - Load XML-Feed-0.01 into trunk. - commit ba87bd3 ------------------------------------------------------------------- Tue Apr 22 19:11:11 CEST 2008 - simon@thegestalt.org - Set up repo structure - commit cb6b911 libxml-feed-perl-0.53+dfsg.orig/MANIFEST.SKIP0000444000175000017500000000012712633540754017646 0ustar gregoagregoa\.tar\.gz$ \.svn \.git \.bak$ _build Build$ blib Makefile$ ^MYMETA.yml$ ^MYMETA\.json$ libxml-feed-perl-0.53+dfsg.orig/Build.PL0000444000175000017500000000415012633540754017244 0ustar gregoagregoause Module::Build; my $build = Module::Build ->new( module_name => "XML::Feed", dist_abstract => "XML Syndication Feed Support", dist_author => 'Six Apart', license => 'perl', script_files => [ ], requires => { 'Class::ErrorHandler' => 0, 'DateTime' => 0, 'DateTime::Format::Mail' => 0, 'DateTime::Format::W3CDTF' => 0, 'Feed::Find' => 0, 'HTML::Entities' => 0, 'HTML::TokeParser' => 0, 'List::Util' => 0, 'LWP::UserAgent' => 0, 'Module::Pluggable' => 0, 'URI::Fetch' => 0, 'XML::Atom' => '0.38', 'XML::LibXML' => '1.66', 'XML::RSS' => '1.47', 'Test::More' => 0, 'Scalar::Util' => 0, }, build_requires => { 'URI' => 0, }, create_makefile_pl => 'traditional', meta_merge => { resources => { repository => "https://github.com/davorg/xml-feed", }, x_contributors => [ 'Dave Cross ', 'Jakob Voss ', 'Tatsuhiko Miyagawa ', 'Simon Wistow ', 'Gabor Szabo ', 'Minty Walker ', 'Karen Etheridge ', 'Gerard Ribugent Navarro ', ], }, ); $build->create_build_script; libxml-feed-perl-0.53+dfsg.orig/README0000444000175000017500000000136012633540754016630 0ustar gregoagregoa$Id$ This is XML::Feed, an abstraction above the RSS and Atom syndication feed formats. It supports both parsing and autodiscovery of feeds. PREREQUISITES * Class::ErrorHandler * XML::RSS * XML::Atom * DateTime * DateTime::Format::Mail * DateTime::Format::W3CDTF * List::Util * Feed::Find * URI::Fetch INSTALLATION XML::Feed installation is straightforward. If your CPAN shell is set up, you should just be able to do % perl -MCPAN -e 'install XML::Feed' Alternatively, you can download it, unpack it, and then build it like this (using Module::Build): % perl Build.PL % ./Build installdeps % ./Build % ./Build test Then install it: % ./Build install Six Apart / cpan@sixapart.com libxml-feed-perl-0.53+dfsg.orig/eg/0000755000175000017500000000000012633540754016345 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/eg/check_feed.pl0000444000175000017500000000365712633540754020753 0ustar gregoagregoause strict; use warnings; use v5.10; =head1 DESCRIPTION Given a URL of an Atom or RSS feed or a filename of an already downloaded feed, this script will try to parse it and print out what it understands from the feed. =cut use XML::Feed; my $src = shift; die "Usage: $0 FILE|URL\n" if not $src; binmode STDOUT, 'utf8'; binmode STDERR, 'utf8'; my $source = $src; if ($src =~ m{^https?://}) { $source = URI->new($src); } else { if (not -f $source) { die "'$source' does not look like a URL and it does not exist on the file-system either.\n"; } } my $feed = XML::Feed->parse( $source ) or die XML::Feed->errstr; say 'Title: ' . ($feed->title // ''); say 'Tagline: ' . ($feed->tagline // ''); say 'Format: ' . ($feed->format // ''); say 'Author: ' . ($feed->author // ''); say 'Link: ' . ($feed->link // ''); say 'Base: ' . ($feed->base // ''); say 'Language: ' . ($feed->language // ''); say 'Copyright: ' . ($feed->copyright // ''); say 'Modified: ' . ($feed->modified // ''); # DateTime object say 'Generator: ' . ($feed->generator // ''); for my $entry ($feed->entries) { say ''; say ' Link: ' . ($entry->link // ''); say ' Author: ' . ($entry->author // ''); say ' Title: ' . ($entry->title // ''); say ' Caregory: ' . ($entry->category // ''); say ' Id: ' . ($entry->id // ''); say ' Issued: ' . ($entry->issued // ''); # DateTime object say ' Modified: ' . ($entry->modified // ''); # DateTime object say ' Lat: ' . ($entry->lat // ''); say ' Long: ' . ($entry->long // ''); say ' Format: ' . ($entry->format // ''); say ' Tags: ' . ($entry->tags // ''); say ' Enclosure: ' . ($entry->enclosure // ''); say ' Summary: ' . ($entry->summary->body // ''); say ' Content: ' . ($entry->content->body // ''); } libxml-feed-perl-0.53+dfsg.orig/t/0000755000175000017500000000000012633540754016215 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/t/04-splice-atom.t0000444000175000017500000000100412633540754021031 0ustar gregoagregoause strict; use Test::More tests => 3; use XML::Feed; my $feed = XML::Feed->new('Atom'); my $other = XML::Feed->parse('t/samples/atom.xml')->convert('Atom'); $feed->splice($other); is(scalar $feed->entries, 2, '2 entries in the feed after splicing'); $feed->splice($other); is(scalar $feed->entries, 2, 'Still 2 entries after splicing again'); $other = XML::Feed->parse('t/samples/rss10.xml')->convert('Atom'); $feed->splice($other); is(scalar $feed->entries, 4, 'Now 4 entries after splicing in RSS 1.0 feed'); libxml-feed-perl-0.53+dfsg.orig/t/17-double.t0000444000175000017500000000145512633540754020104 0ustar gregoagregoause Test::More 'no_plan'; use XML::Feed; my $rss = XML::Feed->parse('t/samples/rss10-double.xml'); isa_ok($rss, 'XML::Feed::Format::RSS'); my $rss_entry = ($rss->entries)[0]; isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS'); my $rss_content = $rss_entry->content; isa_ok($rss_content, 'XML::Feed::Content'); is($rss_content->type, 'text/html', 'Correct content type'); like($rss_content->body, qr(<|<), 'Contains HTML tags'); my $atom = $rss->convert('Atom'); isa_ok($atom, 'XML::Feed::Format::Atom'); my $atom_entry = ($atom->entries)[0]; isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom'); my $atom_content = $atom_entry->content; isa_ok($atom_content, 'XML::Feed::Content'); is($atom_content->type, 'text/html', 'Correct content type'); like($atom_content->body, qr(<|<), 'Contains HTML tags'); libxml-feed-perl-0.53+dfsg.orig/t/22-bug73160.t0000444000175000017500000000122512633540754017777 0ustar gregoagregoause strict; use warnings; use Test::More; use XML::Feed; my $file = 't/samples/rss10-datespaces.xml'; my $feed = XML::Feed->parse($file); isa_ok($feed, 'XML::Feed::Format::RSS'); ok(my $date = $feed->modified, 'Got a feed modified date'); isa_ok($date, 'DateTime'); my $link = $feed->link; unlike($link, qr[^\s], 'No spaces at start of link'); unlike($link, qr[\s$], 'No spaces at end of link'); my $entry = ($feed->entries)[0]; ok(my $iss = $entry->issued, 'Got an entry issued date'); isa_ok($iss, 'DateTime'); $link = $entry->link; unlike($link, qr[^\s], 'No spaces at start of link'); unlike($link, qr[\s$], 'No spaces at end of link'); done_testing; libxml-feed-perl-0.53+dfsg.orig/t/05-atom10-link.t0000444000175000017500000000043612633540754020661 0ustar gregoagregoause strict; use XML::Feed; use Test::More; plan tests => 3; my $feed = XML::Feed->parse("t/samples/atom-10-example.xml"); is $feed->title, 'Example Feed'; is $feed->link, 'http://example.org/', "link without rel"; my $e = ($feed->entries)[0]; ok $e->link, 'entry link without rel'; libxml-feed-perl-0.53+dfsg.orig/t/21-rss2-permalinks.t0000444000175000017500000000042012633540754021650 0ustar gregoagregoause strict; use warnings; use Test::More tests => 2; use XML::Feed; my $file = 't/samples/rss20-p.xml'; my $feed = XML::Feed->parse($file); isa_ok($feed, 'XML::Feed::Format::RSS'); my $entry = ($feed->entries)[0]; is($entry->link, 'http://creograf.ru/post/regexp -js'); libxml-feed-perl-0.53+dfsg.orig/t/11-xml-base-rss.t0000444000175000017500000000261112633540754021134 0ustar gregoagregoause strict; use Test::More; use XML::Feed; use XML::RSS; plan tests => 13; my $feed = XML::Feed->parse('t/samples/base_rss.xml'); my ($entry) = $feed->entries; my $content = $entry->content; is($feed->base, "http://example.org/", "Got feed base"); is($entry->base, "http://example.org/archives/", "Got entry base"); is($content->base, "http://example.org/archives/000001.html", "Got content base"); my $xml = $feed->as_xml; my $new; ok($new = XML::Feed->parse(\$xml), "Parsed old feed"); my ($new_entry) = $new->entries; my $new_content = $entry->content; is($new->base, "http://example.org/", "Got feed base"); is($new_entry->base, "http://example.org/archives/", "Got entry base"); is($new_content->base, "http://example.org/archives/000001.html", "Got content base"); ok($feed->base("http://foo.com/"), "Set feed base"); ok($entry->base("http://foo.com/archives/"), "Set entry base"); ok($content->base("http://foo.com/archives/000001.html"), "Set content base"); is($feed->base, "http://foo.com/", "Got feed base"); is($entry->base, "http://foo.com/archives/", "Got entry base"); is($content->base, "http://foo.com/archives/000001.html", "Got content base"); libxml-feed-perl-0.53+dfsg.orig/t/pod.t0000444000175000017500000000031312633540754017157 0ustar gregoagregoa#!perl use strict; use warnings; use Test::More; eval 'use Test::Pod 1.14'; plan skip_all => 'Test::Pod 1.14 required for testing POD' if $@; all_pod_files_ok( grep { /^Boomerang/ } all_pod_files() ); libxml-feed-perl-0.53+dfsg.orig/t/10-mix-and-match.t0000444000175000017500000000141512633540754021246 0ustar gregoagregoause strict; use Test::More tests => 6; use XML::Feed; my $afeed = XML::Feed->new('Atom'); my $rfeed = XML::Feed->new('RSS'); my $atom = make_entry('Atom'); my $rss = make_entry('RSS'); ok($afeed->add_entry($atom), "Added Atom entry to Atom feed"); ok($afeed->add_entry($rss), "Added RSS entry to Atom feed"); ok($rfeed->add_entry($rss), "Added RSS entry to RSS feed"); ok($rfeed->add_entry($atom), "Added Atom entry to RSS feed"); is(scalar $afeed->entries, 2, 'Now 2 entries in Atom feed'); is(scalar $rfeed->entries, 2, 'Now 2 entries in RSS feed'); sub make_entry { my $format = shift; my $entry = XML::Feed::Entry->new($format); $entry->title("Test Title ".rand()); $entry->content("Foo"); $entry->summary("Bar"); return $entry; } libxml-feed-perl-0.53+dfsg.orig/t/23-eval.t0000444000175000017500000000146312633540754017555 0ustar gregoagregoause strict; use warnings; use Test::More tests => 8; use XML::Feed; use XML::Feed::Entry; eval { XML::Feed::Entry->new('Nofeed'); }; like $@, qr{Unsupported format Nofeed:}, 'Unsupported format'; { my $rss = XML::Feed::Entry->new('RSS'); isa_ok $rss, 'XML::Feed::Entry::Format::RSS'; my $atom = XML::Feed::Entry->new('Atom'); isa_ok $atom, 'XML::Feed::Entry::Format::Atom'; my $default = XML::Feed::Entry->new(); isa_ok $default, 'XML::Feed::Entry::Format::Atom'; } eval { XML::Feed->new('Nofeed'); }; like $@, qr{Unsupported format Nofeed:}, 'Unsupported format'; { my $rss = XML::Feed->new('RSS'); isa_ok $rss, 'XML::Feed::Format::RSS'; my $atom = XML::Feed->new('Atom'); isa_ok $atom, 'XML::Feed::Format::Atom'; my $default = XML::Feed->new(); isa_ok $default, 'XML::Feed::Format::Atom'; } libxml-feed-perl-0.53+dfsg.orig/t/15-odd-date.t0000444000175000017500000000050712633540754020306 0ustar gregoagregoa#!perl -w use strict; use Test::More tests => 3; use XML::Feed; ok (my $feed = XML::Feed->parse('t/samples/rss10-odd-date.xml'), "Parsed file"); ok (my ($entry) = $feed->entries, "Got entry"); is ($entry->issued . '',"2009-05-29T20:17:07", "Got correct issued date"); libxml-feed-perl-0.53+dfsg.orig/t/12-multi-categories-atom.t0000444000175000017500000000015012633540754023027 0ustar gregoagregoa#!perl -w use strict; use vars qw($type $field); $type = "atom"; require 't/12-multi-categories.base'; libxml-feed-perl-0.53+dfsg.orig/t/02-create.t0000444000175000017500000001132412633540754020063 0ustar gregoagregoause strict; use Test::More; use XML::Feed; use XML::Feed::Entry; use XML::Feed::Content; use DateTime; for my $format (qw( Atom RSS )) { my $feed = XML::Feed->new($format); isa_ok($feed, 'XML::Feed::Format::' . $format); like($feed->format, qr/^$format/, 'Format is correct'); $feed->title('My Feed'); is($feed->title, 'My Feed', 'feed title is correct'); $feed->link('http://www.example.com/'); is($feed->link, 'http://www.example.com/', 'feed link is correct'); $feed->description('Wow!'); is($feed->description, 'Wow!', 'feed description is correct'); is($feed->tagline, 'Wow!', 'tagline works as alias'); $feed->tagline('Again'); is($feed->tagline, 'Again', 'setting via tagline works'); $feed->language('en_US'); is($feed->language, 'en_US', 'feed language is correct'); $feed->author('Ben'); is($feed->author, 'Ben', 'feed author is correct'); $feed->copyright('Copyright 2005 Me'); is($feed->copyright, 'Copyright 2005 Me', 'feed copyright is correct'); my $now = DateTime->now; $feed->modified($now); isa_ok($feed->modified, 'DateTime', 'modified returns a DateTime'); is($feed->modified->iso8601, $now->iso8601, 'feed modified is correct'); $feed->generator('Movable Type'); is($feed->generator, 'Movable Type', 'feed generator is correct'); ok($feed->as_xml, 'as_xml returns something'); my $entry = XML::Feed::Entry->new($format); isa_ok($entry, 'XML::Feed::Entry::Format::' . $format); $entry->title('Foo Bar'); is($entry->title, 'Foo Bar', 'entry title is correct'); $entry->link('http://www.example.com/foo/bar.html'); is($entry->link, 'http://www.example.com/foo/bar.html', 'entry link is correct'); $entry->summary('This is a summary.'); isa_ok($entry->summary, 'XML::Feed::Content'); is($entry->summary->body, 'This is a summary.', 'entry summary is correct'); $entry->content('This is the content.'); isa_ok($entry->content, 'XML::Feed::Content'); is($entry->content->type, 'text/html', 'entry content type is correct'); is($entry->content->body, 'This is the content.', 'entry content body is correct'); $entry->content(XML::Feed::Content->new({ body => 'This is the content (again).', type => 'text/plain', })); isa_ok($entry->content, 'XML::Feed::Content'); is($entry->content->body, 'This is the content (again).', 'setting with XML::Feed::Content works'); $entry->category('Television'); is($entry->category, 'Television', 'entry category is correct'); $entry->author('Foo Baz'); is($entry->author, 'Foo Baz', 'entry author is correct'); $entry->id('foo:bar-15132'); is($entry->id, 'foo:bar-15132', 'entry id is correct'); my $dt = DateTime->now; $entry->issued($dt); isa_ok($entry->issued, 'DateTime'); is($entry->issued->iso8601, $dt->iso8601, 'entry issued is correct'); $entry->modified($dt); isa_ok($entry->modified, 'DateTime'); is($entry->modified->iso8601, $dt->iso8601, 'entry modified is correct'); $feed->add_entry($entry); my @e = $feed->entries; is(scalar @e, 1, 'One post in the feed'); is($e[0]->title, 'Foo Bar', 'Correct post'); is($e[0]->content->body, 'This is the content (again).', 'content is still correct'); if ($format eq 'Atom') { like $feed->as_xml, qr/This is the content/; } if ($format eq 'RSS') { like $feed->as_xml, qr{xmlns:dcterms="http://purl.org/dc/terms/"}; } $feed->self_link("http://tor.tld/my-feed.rss"); if ($format eq "RSS") { like ($feed->as_xml(), qr{\Q\E}, "Feed contains the atom:link"); } elsif ($format eq "Atom") { like ($feed->as_xml(), qr{\Q\E}, "Feed contains the atom:link"); my %rfc5005 = ( first_link => "http://tor.tld/my-feed.xml?page=1", next_link => "http://tor.tld/my-feed.xml?page=4", previous_link => "http://tor.tld/my-feed.xml?page=2", last_link => "http://tor.tld/my-feed.xml?page=99", current_link => "http://tor.tld/archive/2.xml", prev_archive_link => "http://tor.tld/archive/1.xml", next_archive_link => "http://tor.tld/archive/3.xml", ); while ( my($name,$url) = each(%rfc5005) ) { $feed->$name($url); $name =~ s/_link$//; $name =~ s/_/-/g; like ($feed->as_xml(), qr{\Q\E}, "Feed contains an RFC 5005 rel=\"$name\" link"); } } } done_testing; libxml-feed-perl-0.53+dfsg.orig/t/20-no-enclosures.t0000444000175000017500000000045612633540754021420 0ustar gregoagregoause strict; use Test::More; use XML::Feed; my @formats = qw/rss20 atom/; plan tests => 2*@formats; for my $format (@formats) { ok (my $feed = XML::Feed->parse("t/samples/$format.xml"), "Parsed $format"); my ($entry) = $feed->entries; my @enclosure = $entry->enclosure; is(@enclosure, 0); } libxml-feed-perl-0.53+dfsg.orig/t/09-missing-content-bug.t0000444000175000017500000000232612633540754022525 0ustar gregoagregoa#!perl -w use strict; use Test::More tests => 13; use_ok("XML::Feed"); my $rss_feed; ok($rss_feed = XML::Feed->new('RSS'), "Got feed"); ok($rss_feed->title('Happy Feed'), "Set feed title"); ok($rss_feed->author('Ask Bjork Tate'), "Set feed author"); ok($rss_feed->link('http://nowhere.com'), "Set feed link"); ok($rss_feed->language('en-US'), "Set feed language"); ok($rss_feed->description('not existing since who knows when'), "Set feed description"); my $rss_entry; my $content = <<'EOC'; But that's XML::RSS's problem. Oh, and this would be an XML::Feed::Content item as specced in the docs, but there is no constructor documented for XML::Feed::Content and I know this works anyway. EOC ok($rss_entry = XML::Feed::Entry->new('RSS'), "Got entry"); ok($rss_entry->title("Title is not always a required element in RSS2"), "Set entry title"); ok($rss_entry->content($content), "Set entry content"); ok($rss_entry->link('http://nowhere.com/themiddle'), "Set entry link"); ok($rss_feed->add_entry($rss_entry), "Added entry"); like($rss_feed->as_xml, qr/problem/i, "Feed has body"); libxml-feed-perl-0.53+dfsg.orig/t/12-multi-categories-rss.t0000444000175000017500000000014712633540754022704 0ustar gregoagregoa#!perl -w use strict; use vars qw($type $field); $type = "rss"; require 't/12-multi-categories.base'; libxml-feed-perl-0.53+dfsg.orig/t/12-multi-categories.base0000444000175000017500000000137612633540754022553 0ustar gregoagregoause strict; use Test::More tests => 6; use XML::Feed; $field ||= "categories"; ok(my $feed = XML::Feed->parse("t/samples/${type}-multiple-${field}.xml"), "Parsed $type file with multiple categories"); my ($entry) = $feed->entries; is_deeply( [$entry->category()], ["foo", "bar", "quux", "simon's tags"], "Got all categories"); my $xml = $feed->as_xml; ok($feed = XML::Feed->parse(\$xml), "Reparsed $type from string"); is_deeply( [$entry->category()], ["foo", "bar", "quux", "simon's tags"], "Got all categories again"); ok($entry->category("quirka fleeg"), "Added a category"); is_deeply( [$entry->category()], ["foo", "bar", "quux", "simon's tags", "quirka fleeg"], "Got new category"); libxml-feed-perl-0.53+dfsg.orig/t/01-parse.t0000444000175000017500000000472612633540754017741 0ustar gregoagregoause strict; use Test::More tests => 75; use XML::Feed; use URI; my %Feeds = ( 't/samples/atom.xml' => 'Atom', 't/samples/rss10.xml' => 'RSS 1.0', 't/samples/rss20.xml' => 'RSS 2.0', ); ## First, test all of the various ways of calling parse. my $feed; my $file = 't/samples/atom.xml'; $feed = XML::Feed->parse($file); isa_ok($feed, 'XML::Feed::Format::Atom'); is($feed->title, 'First Weblog'); open my $fh, $file or die "Can't open $file: $!"; $feed = XML::Feed->parse($fh); isa_ok($feed, 'XML::Feed::Format::Atom'); is($feed->title, 'First Weblog'); seek $fh, 0, 0; my $xml = do { local $/; <$fh> }; $feed = XML::Feed->parse(\$xml); isa_ok($feed, 'XML::Feed::Format::Atom'); is($feed->title, 'First Weblog'); $feed = XML::Feed->parse(URI->new("file:$file")); isa_ok($feed, 'XML::Feed::Format::Atom'); is($feed->title, 'First Weblog'); ## Then try calling all of the unified API methods. for my $file (sort keys %Feeds) { my $feed = XML::Feed->parse($file) or die XML::Feed->errstr; my($subclass) = $Feeds{$file} =~ /^(\w+)/; isa_ok($feed, 'XML::Feed::Format::' . $subclass); is($feed->format, $Feeds{$file}); is($feed->language, 'en-us'); is($feed->title, 'First Weblog'); is($feed->link, 'http://localhost/weblog/'); is($feed->tagline, 'This is a test weblog.'); is($feed->description, 'This is a test weblog.'); my $dt = $feed->modified; isa_ok($dt, 'DateTime'); $dt->set_time_zone('UTC'); is($dt->iso8601, '2004-05-30T07:39:57'); is($feed->author, 'Melody'); my @entries = $feed->entries; is(scalar @entries, 2); my $entry = $entries[0]; is($entry->title, 'Entry Two'); is($entry->link, 'http://localhost/weblog/2004/05/entry_two.html'); $dt = $entry->issued; isa_ok($dt, 'DateTime'); $dt->set_time_zone('UTC'); is($dt->iso8601, '2004-05-30T07:39:25'); like($entry->content->body, qr/

Hello!<\/p>/); is($entry->summary->body, 'Hello!...'); is(($entry->category)[0], 'Travel'); is($entry->category, 'Travel'); is($entry->author, 'Melody'); ok($entry->id); } $feed = XML::Feed->parse('t/samples/rss20-no-summary.xml') or die XML::Feed->errstr; my $entry = ($feed->entries)[0]; ok(!$entry->summary->body); like($entry->content->body, qr/

This is a test.<\/p>/); $feed = XML::Feed->parse('t/samples/rss10-invalid-date.xml') or die XML::Feed->errstr; $entry = ($feed->entries)[0]; ok(!$entry->issued); ## Should return undef, but not die. ok(!$entry->modified); ## Same. libxml-feed-perl-0.53+dfsg.orig/t/11-xml-base-atom.t0000444000175000017500000000256412633540754021274 0ustar gregoagregoause strict; use Test::More tests => 13; use XML::Feed; my $feed = XML::Feed->parse('t/samples/base_atom.xml'); my ($entry) = $feed->entries; my $content = $entry->content; is($feed->base, "http://example.org/", "Got feed base"); is($entry->base, "http://example.org/archives/", "Got entry base"); is($content->base, "http://example.org/archives/000001.html", "Got content base"); my $xml = $feed->as_xml; my $new; ok($new = XML::Feed->parse(\$xml), "Parsed old feed"); my ($new_entry) = $new->entries; my $new_content = $entry->content; is($new->base, "http://example.org/", "Got feed base"); is($new_entry->base, "http://example.org/archives/", "Got entry base"); is($new_content->base, "http://example.org/archives/000001.html", "Got content base"); ok($feed->base("http://foo.com/"), "Set feed base"); ok($entry->base("http://foo.com/archives/"), "Set entry base"); ok($content->base("http://foo.com/archives/000001.html"), "Set content base"); is($feed->base, "http://foo.com/", "Got feed base"); is($entry->base, "http://foo.com/archives/", "Got entry base"); is($content->base, "http://foo.com/archives/000001.html", "Got content base"); libxml-feed-perl-0.53+dfsg.orig/t/14-multi-enclosures.t0000444000175000017500000001045512633540754022141 0ustar gregoagregoa#!perl -w use strict; use Test::More; use XML::Feed; use XML::Feed::Enclosure; $XML::Feed::MULTIPLE_ENCLOSURES=1; my @formats = qw(atom rss20); plan tests => scalar(@formats)*38; foreach my $format (@formats) { ok (my $feed = XML::Feed->parse("t/samples/$format-multi-enclosure.xml"), "Parsed $format"); my ($entry) = $feed->entries; ok (my @enclosures = $entry->enclosure, "Got enclosure"); ok ($enclosures[0]->isa("XML::Feed::Enclosure"), "Object isa XML::Feed::Enclosure"); is ($enclosures[0]->type, "audio/mpeg", "Got the enclosure mime type"); is ($enclosures[0]->length, "2478719", "Got enclosure length"); is ($enclosures[0]->url, "http://example.com/sample_podcast.mp3", "Got enclosure url"); ok ($enclosures[1]->isa("XML::Feed::Enclosure"), "Object isa XML::Feed::Enclosure"); is ($enclosures[1]->type, "video/mpeg", "Got the enclosure mime type"); is ($enclosures[1]->length, "8888", "Got enclosure length"); is ($enclosures[1]->url, "http://example.com/sample_movie.mpg", "Got enclosure url"); ok (my $tmp = XML::Feed::Enclosure->new({ type => "image/jpeg" }), "Created a new enclosure"); is ($tmp->type, "image/jpeg", "Got type back"); ok ($tmp->url("http://example.com/sample_image.jpg"), "Set url"); ok ($tmp->length("1337"), "Set length"); ok ($entry->enclosure($tmp), "Set the enclosure"); ok (@enclosures = $entry->enclosure, "Got enclosure again"); ok ($enclosures[-1]->isa("XML::Feed::Enclosure"), "Object still isa XML::Feed::Enclosure"); is ($enclosures[-1]->type, "image/jpeg", "Got the enclosure mime type"); is ($enclosures[-1]->length, "1337", "Got enclosure length again"); is ($enclosures[-1]->url, "http://example.com/sample_image.jpg", "Got enclosure url again"); my $xml = $feed->as_xml; ok ($feed = XML::Feed->parse(\$xml), "Parsed xml again"); ok (@enclosures = $entry->enclosure, "Got enclosure again"); ok ($enclosures[0]->isa("XML::Feed::Enclosure"), "Object isa XML::Feed::Enclosure"); is ($enclosures[0]->type, "audio/mpeg", "Got the enclosure mime type"); is ($enclosures[0]->length, "2478719", "Got enclosure length"); is ($enclosures[0]->url, "http://example.com/sample_podcast.mp3", "Got enclosure url"); ok ($enclosures[1]->isa("XML::Feed::Enclosure"), "Object isa XML::Feed::Enclosure"); is ($enclosures[1]->type, "video/mpeg", "Got the enclosure mime type"); is ($enclosures[1]->length, "8888", "Got enclosure length"); is ($enclosures[1]->url, "http://example.com/sample_movie.mpg", "Got enclosure url"); ok ($enclosures[2]->isa("XML::Feed::Enclosure"), "Object still isa XML::Feed::Enclosure"); is ($enclosures[2]->type, "image/jpeg", "Got the enclosure mime type"); is ($enclosures[2]->length, "1337", "Got enclosure length again"); is ($enclosures[2]->url, "http://example.com/sample_image.jpg", "Got enclosure url again"); ok ($enclosures[-1]->isa("XML::Feed::Enclosure"), "Object still isa XML::Feed::Enclosure"); is ($enclosures[-1]->type, "image/jpeg", "Got the enclosure mime type"); is ($enclosures[-1]->length, "1337", "Got enclosure length again"); is ($enclosures[-1]->url, "http://example.com/sample_image.jpg", "Got enclosure url again"); } libxml-feed-perl-0.53+dfsg.orig/t/18-double2.t0000444000175000017500000000314112633540754020161 0ustar gregoagregoause strict; use warnings; use Test::More tests => 14; use XML::Feed; use File::Spec; { my $rss = XML::Feed->parse( File::Spec->catfile(File::Spec->curdir(), "t", "samples", "rss20-double.xml" ) ); # TEST isa_ok($rss, 'XML::Feed::Format::RSS'); my $rss_entry = ($rss->entries)[0]; # TEST isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS'); my $rss_content = $rss_entry->content; # TEST isa_ok($rss_content, 'XML::Feed::Content'); # TEST is($rss_content->type, 'text/html', 'Correct content type'); # TEST like($rss_content->body, qr(<|<), 'Contains HTML tags'); # TEST like($rss_content->body, qr{\QDancer}, 'Contains HTML tags'); unlike($rss->as_xml, qr{&lt;}, 'No double encoding'); my $atom = $rss->convert('Atom'); # TEST isa_ok($atom, 'XML::Feed::Format::Atom'); my $atom_entry = ($atom->entries)[0]; # TEST isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom'); my $atom_content = $atom_entry->content; # TEST isa_ok($atom_content, 'XML::Feed::Content'); # TEST TODO: { local $TODO = 'Needs more investigation'; is($atom_content->type, 'text/html', 'Correct content type'); } # TEST like($atom_content->body, qr(<|<), 'Contains HTML tags'); # TEST like($atom_content->body, qr{\QDancer}, 'Contains HTML tags'); unlike($atom->as_xml, qr{&lt;}, 'No double encoding'); } libxml-feed-perl-0.53+dfsg.orig/t/04-splice-rss.t0000444000175000017500000000100312633540754020677 0ustar gregoagregoause strict; use Test::More tests => 3; use XML::Feed; my $feed = XML::Feed->new('RSS'); my $other = XML::Feed->parse('t/samples/atom.xml')->convert('Atom'); $feed->splice($other); is(scalar $feed->entries, 2, '2 entries in the feed after splicing'); $feed->splice($other); is(scalar $feed->entries, 2, 'Still 2 entries after splicing again'); $other = XML::Feed->parse('t/samples/rss10.xml')->convert('Atom'); $feed->splice($other); is(scalar $feed->entries, 4, 'Now 4 entries after splicing in RSS 1.0 feed'); libxml-feed-perl-0.53+dfsg.orig/t/pod-coverage.t0000444000175000017500000000054412633540754020756 0ustar gregoagregoa#!perl use strict; use warnings; use Test::More; eval 'use Test::Pod::Coverage 1.04'; plan skip_all => 'Test::Pod::Coverage 1.04 required for testing POD coverage' if $@; my @modules = grep { !/(RSS|Atom)/ }Test::Pod::Coverage::all_modules(); plan tests => scalar(@modules); pod_coverage_ok($_, { also_private => [ qr/^init_empty/ ], },) for @modules; libxml-feed-perl-0.53+dfsg.orig/t/08-convert-summary-bug.t0000444000175000017500000000104112633540754022547 0ustar gregoagregoause strict; use Test::More tests => 1; use XML::Feed; use XML::Feed::Entry; my $feed = XML::Feed->new(); $feed->title('My Feed'); $feed->link('http://www.example.com/'); $feed->description('Wow!'); my $entry = XML::Feed::Entry->new(); $entry->title('Foo Bar'); $entry->link('http://www.example.com/foo/bar.html'); $entry->content('This is the content, but there is no summary.'); $entry->author('Foo Baz'); $feed->add_entry($entry); unlike($feed->convert('Atom')->as_xml(), qr{

}, 'no summary tag after converting to Atom'); libxml-feed-perl-0.53+dfsg.orig/t/12-multi-subjects-rss.t0000444000175000017500000000016112633540754022375 0ustar gregoagregoa#!perl -w use vars qw($type $field); $type = "rss"; $field = "subjects"; require 't/12-multi-categories.base'; libxml-feed-perl-0.53+dfsg.orig/t/16-convert-mult-categories.t0000444000175000017500000000075012633540754023410 0ustar gregoagregoause strict; use Test::More tests => 2; use XML::Feed; my $feed = XML::Feed->parse("t/samples/rss-multiple-categories.xml"); my ($entry) = $feed->entries; is_deeply( [$entry->category()], ["foo", "bar", "quux", "simon's tags"], "Got all categories"); my ($converted_entry) = $feed->convert('Atom')->entries; is_deeply( [$converted_entry->category()], ["foo", "bar", "quux", "simon's tags"], "All categories in place after conversion"); libxml-feed-perl-0.53+dfsg.orig/t/07-atom10-create.t0000444000175000017500000000255012633540754021170 0ustar gregoagregoause strict; use Test::More; use XML::Feed; use DateTime; my $now = DateTime->now(); my $feed = XML::Feed->new('Atom'); $feed->title("foo"); $feed->description("Atom 1.0 feed"); $feed->link("http://example.org/"); $feed->id("tag:cpan.org;xml-feed-atom"); $feed->modified($now); my $entry = XML::Feed::Entry->new('Atom'); $entry->title("1st Entry"); $entry->link("http://example.org/"); $entry->category("blah"); $entry->content("

Hello world.

"); $entry->id("tag:cpan.org;xml-feed-atom-entry"); $entry->modified($now); $feed->add_entry($entry); my $xml = $feed->as_xml; like $xml, qr!!; like $xml, qr!
!; # roundtrip $feed = XML::Feed->parse(\$xml); is $feed->format, 'Atom'; is $feed->title, "foo"; is $feed->description, "Atom 1.0 feed"; is $feed->link, "http://example.org/"; is $feed->id, "tag:cpan.org;xml-feed-atom"; is $feed->modified->iso8601, $now->iso8601; my @entries = $feed->entries; is @entries, 1; $entry = $entries[0]; is $entry->title, '1st Entry'; is $entry->link, 'http://example.org/'; is $entry->category, 'blah'; is $entry->content->type, 'text/html'; like $entry->content->body, qr!\s*

Hello world.

\s*!s; is $entry->id, "tag:cpan.org;xml-feed-atom-entry"; is $entry->modified->iso8601, $now->iso8601; done_testing(); libxml-feed-perl-0.53+dfsg.orig/t/14-enclosures.t0000444000175000017500000000474412633540754021015 0ustar gregoagregoa#!perl -w use strict; use Test::More; use XML::Feed; use XML::Feed::Enclosure; my @formats = qw(atom rss20); plan tests => scalar(@formats)*22; foreach my $format (@formats) { ok (my $feed = XML::Feed->parse("t/samples/$format-enclosure.xml"), "Parsed $format"); my ($entry) = $feed->entries; ok (my $enclosure = $entry->enclosure, "Got enclosure"); ok ($enclosure->isa("XML::Feed::Enclosure"), "Object isa XML::Feed::Enclosure"); is ($enclosure->type, "audio/mpeg", "Got the enclosure mime type"); is ($enclosure->length, "2478719", "Got enclosure length"); is ($enclosure->url, "http://example.com/sample_podcast.mp3", "Got enclosure url"); ok (my $tmp = XML::Feed::Enclosure->new({ type => "image/jpeg" }), "Created a new enclosure"); is ($tmp->type, "image/jpeg", "Got type back"); ok ($tmp->url("http://example.com/sample_image.jpg"), "Set url"); ok ($tmp->length("1337"), "Set length"); ok ($entry->enclosure($tmp), "Set the enclosure"); ok ($enclosure = $entry->enclosure, "Got enclosure again"); ok ($enclosure->isa("XML::Feed::Enclosure"), "Object still isa XML::Feed::Enclosure"); is ($enclosure->type, "image/jpeg", "Got the enclosure mime type"); is ($enclosure->length, "1337", "Got enclosure length again"); is ($enclosure->url, "http://example.com/sample_image.jpg", "Got enclosure url again"); my $xml = $feed->as_xml; ok ($feed = XML::Feed->parse(\$xml), "Parsed xml again"); ok ($enclosure = $entry->enclosure, "Got enclosure again"); ok ($enclosure->isa("XML::Feed::Enclosure"), "Object still isa XML::Feed::Enclosure"); is ($enclosure->type, "image/jpeg", "Got the enclosure mime type"); is ($enclosure->length, "1337", "Got enclosure length again"); is ($enclosure->url, "http://example.com/sample_image.jpg", "Got enclosure url again"); } libxml-feed-perl-0.53+dfsg.orig/t/00-compile.t0000444000175000017500000000023612633540754020246 0ustar gregoagregoause strict; use Test::More tests => 4; use_ok('XML::Feed'); use_ok('XML::Feed::Entry'); use_ok('XML::Feed::Format::RSS'); use_ok('XML::Feed::Format::Atom'); libxml-feed-perl-0.53+dfsg.orig/t/19-double3.t0000444000175000017500000000317212633540754020167 0ustar gregoagregoause strict; use warnings; use Test::More tests => 14; use XML::Feed; use File::Spec; { my $rss = XML::Feed->parse( File::Spec->catfile(File::Spec->curdir(), "t", "samples", "rss10-double2.xml" ) ); # TEST isa_ok($rss, 'XML::Feed::Format::RSS'); my $rss_entry = ($rss->entries)[0]; # TEST isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS'); my $rss_content = $rss_entry->content; # TEST isa_ok($rss_content, 'XML::Feed::Content'); # TEST is($rss_content->type, 'text/html', 'Correct content type'); # TEST like($rss_content->body, qr(<|<), 'Contains HTML tags'); # TEST like($rss_content->body, qr{\Q}, 'Contains HTML tags'); unlike($rss->as_xml, qr{&lt;}, 'No double encoding'); my $atom = $rss->convert('Atom'); # TEST isa_ok($atom, 'XML::Feed::Format::Atom'); my $atom_entry = ($atom->entries)[0]; # TEST isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom'); my $atom_content = $atom_entry->content; # TEST isa_ok($atom_content, 'XML::Feed::Content'); # TEST is($atom_content->type, 'text/html', 'Correct content type'); # TEST like($atom_content->body, qr(<|<), 'Contains HTML tags'); # TEST like($atom_content->body, qr{\Q}, 'Contains HTML tags'); unlike($atom->as_xml, qr{&lt;}, 'No double encoding'); } libxml-feed-perl-0.53+dfsg.orig/t/06-atom10.t0000444000175000017500000000077312633540754017733 0ustar gregoagregoause strict; use XML::Feed; use Test::More; plan tests => 7; my $feed = XML::Feed->parse("t/samples/atom-full.xml"); is $feed->title, 'Content Considered Harmful Atom Feed'; is $feed->link, 'http://blog.jrock.us/', "link without rel"; my $e = ($feed->entries)[0]; ok $e->link, 'entry link without rel'; is "".$e->category, "Catalyst", "atom:category support"; is "".$e->modified, "2006-08-09T19:07:58", "atom:updated"; is $e->content->type, 'text/html'; like $e->content->body, qr/^
/; libxml-feed-perl-0.53+dfsg.orig/t/13-category-hash-bug.t0000444000175000017500000000063612633540754022137 0ustar gregoagregoause strict; use Test::More; eval { require XML::RSS::LibXML }; plan skip_all => "XML::RSS::LibXML is required." if $@; plan tests => 20; use XML::Feed; for my $parser (qw( XML::RSS XML::RSS::LibXML )) { $XML::Feed::Format::RSS::PREFERRED_PARSER = $parser; my $f = XML::Feed->parse("t/samples/category-bug.xml"); for my $e ($f->entries) { eval { $e->category }; ok !$@, $@; } } libxml-feed-perl-0.53+dfsg.orig/t/samples/0000755000175000017500000000000012634070640017652 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/t/samples/rss10-odd-date.xml0000444000175000017500000000432612633540754023035 0ustar gregoagregoa Libre.fm Bristol TN 36.595 -82.189 joeyhess's Latest Plays 2009-05-29T20:17:07+01:00 http://alpha.libre.fm/artist/Tom%20Waits/album/Bone%20Machine/track/Black%20Wings Bone Machine Tom Waits: Black Wings libxml-feed-perl-0.53+dfsg.orig/t/samples/atom-multi-enclosure.xml0000444000175000017500000000101712633540754024465 0ustar gregoagregoa Enclosure Demo 2008-10-13T07:45:39Z Attachment/Enclosure Example 2004-11-02T14:44:33 description libxml-feed-perl-0.53+dfsg.orig/t/samples/atom-full.xml0000444000175000017500000002075512633540754022312 0ustar gregoagregoa Content Considered Harmful Atom Feedhttp://blog.jrock.us/This is Jonathan Rockway's Blog, quite possibily the best blog ever. Or something. AngerWhale2006-08-10T02:43:00ZCatalyst + CacheJonathan T. Rockwayjon@jrock.usurn:guid:8D9B9CBE-27DB-11DB-B6C2-F007B8516AA52006-08-09T19:07:58Z

I recently posted this to the Template::Toolkit mailing list, but the moderator rejected it for some reason. (Probably because <jon-perl-list-templates AT jrock.us> is the address that's subscribed, not <jon AT jrock.us>.)

Anyway, here it is. I will expand on this further with actual measurements, but this will have to do for now.

Original Message

Thank you, you raise a good point that I had not fully considered. My goal is to display a dynamically generated page, but where most of the "dynamic" content is actually static for a period amount of time. (Take a news page, for example, where the list of news stories updates once an hour.)

My Reply

I have a similar problem with my blogging software. Most of the content is static, and it's kind of a waste to regenerate everything every time someone views the page. My solution to this problem is to use a Cache::FastMmap object to store the formatted HTML content of each post, keyed on the source material's MD5sum (and filetype, for reasons not relevant to this discussion :)

This results in a nice speedup, since certain HTML filters are slow (OO.org document -> HTML, for example).

I also cache full pages, after they've been assembled by TT, keyed on the md5sum of each included article and some metadata (comment count, tags, etc.) The end result is a 5-20x speed up. With Catalyst's embedded server, I can do about 5 requests per second without cache, but it goes up to about 40-50 requests/second with the cache. So obviously a speedup. (And I'm still not doing a very good job, this was just a 20 minute hack!)

For the gory details, check out the code here:

http://www.jrock.us/trac/blog_software/browser/lib/Blog/Controller/Root.pm#L105 (page cache)

and: http://www.jrock.us/trac/blog_software/browser/lib/Blog/Model/Filesystem/Item.pm#L355 (object cache)

Another caching strategy is to set dynamic pages to be cachable for say, 10 seconds, and then letting Apache's mod_cache (experimental in 2.2.3, but it works for me) do the hard work. Your application gets hit once every ten seconds to refresh Apache's cache, but all the end-user requests are handled by serving from Apache's memory cache. With mpm_worker, it's *super fast*, and a 10 second update delay isn't bad.

If your application is really slow, this will let you increase your slashdot resistance factor (as I call it) enormously. A quick ab against some cached content gave me a requests/per second rate of 1638... much better than whatever your app would do by itself.

And you don't really lose much by taking this approach, other than a 10 second delay with your articles going live... but 10 seconds is nothing if you're getting 1500 requests per second and handling it with an old PIII :)

If this info is useful to anyone else, let me know (off-list) and I'll write up a more detailed article about it :)

Quantum Physics and the Template ToolkitJonathan T. Rockwayjon@jrock.usurn:guid:BB054AF0-2601-11DB-9738-946FBD3128592006-08-07T10:44:20Z

As a programmer, you probably don't spend a lot of time thinking about the similarities between programming and quantum physics. Fortunately for us Perl users, some people do spend a lot of time thinking about physics, and they even wrap up the results in CPAN modules for us!

One such module is Quantum::Superpositions, which let me easily add some nice functionality to my blog software the other day.

As you can see (if you're looking at this article on my blog, not in an RSS reader), I have a list of tags to the left of my main content. If you click one, it shows you a list of articles that have been tagged with that tag. If you select more than one tag, you get this intersection of the two sets (tag1 AND tag2).

That's nice, but I like to use the left navigation bar to show the user where he is in addition to letting him move somewhere else. To do this, I bold the current location, and remove the link. That way, the user won't try to visit the page he's already looking at. This is pretty simple to implement for things like the "home page" or the "archives". You just check the current page, and if the link you're about to print out matches, make it bold instead. That logic looks something like this:

     [% FOREACH category = categories %]
        [% IF category == current_category %]
	   <b>[% category %]</b>
        [% ELSE %]
              [% category %]
        [% END %]
     [% END %]

Simple, and it provides excellent visual cues as to what the user is looking at.

The problem with tags, though, is that an article can have lots of them. The technique above doesn't work there; you need to do a search for each tag. Not a show stopper, but do you really want to do array searches inside the Template Toolkit? No!

And this is where Quantum::Superpositions comes to the rescue. In quantum physics, almost nothing is "certain" -- you can't tell with 100% certainty both where a particle is and what its velocity is. The state of an individual particle is in sort of a flux until you observe, and when you observe, a tangible state comes into existence.

How does this help with tags? By thinking of the set of all tags as a cloud of particles, we can apply the same principle. We don't care what all the tags are until we look at them.

So how do we do this in perl? Let's see an example:

In my Tags.pm Controller, I use the any method from Quantum::Superpositions to collapse the list of tags into a scalar:

   $c->stash->{article_tags} = any(@tags);

Then inside my Template Toolkit View, I "observe" the state as necessary (with the == operator):

     [% FOREACH tag = all_tags %]
        [% IF tag == article_tags %]
	   <b>[% tag %]</b>
        [% ELSE %]
              [% tag %]
        [% END %]
     [% END %]

As you can see, this is exactly the same as what we did when we only had one possible value. If you think about it, it's really the same thing. You just needed to think more about physics :)

Anyway, take a look at this in action:

http://blog.jrock.us/tags/%E3%83%A2%E3%83%BC%E5%A8%98%E3%80%82/music

And then add some cool navigation features to your Catalyst app!

libxml-feed-perl-0.53+dfsg.orig/t/samples/rss10-double.xml0000444000175000017500000000626712633540754022634 0ustar gregoagregoa davorg's Journal http://use.perl.org/~davorg/journal/ davorg's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2009-04-09T12:53:36+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 davorg's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~davorg/journal/ Task::Kensho RPMs http://use.perl.org/~davorg/journal/38730?from=rss <p>One of the first concrete outputs from the <a href="http://www.enlightenedperl.org/">Enlightened Perl Organisation</a> has been <a href="http://search.cpan.org/dist/Task-Kensho/">Task::Kensho</a> - a CPAN module which exists to list a number of other CPAN modules that modern Perl programmers should consider using. if you install Task::Kensho then all of the included modules will automatically be pulled down from CPAN and installed.</p><p>I don't install my modules from CPAN. As I live in the Red Hat world, I like to install RPMs of modules. And I build RPMs for modules that aren't already available in that format (and then I <a href="http://rpm.mag-sol.com/">make them available to everyone</a>).</p><p>So last night I created an RPM for Task::Kensho. This also involved building RPMs for about half of the modules it include which didn't already exist as RPMs in the standard repostories. Those RPMs are now available from <a href="http://rpm.mag-sol.com/">my repository</a> so installing them all could be as simple as <tt>sudo yum install perl-Task-Kensho</tt>. Of course, you can also install individual packages using the appropriate <tt>yum</tt> command.</p><p>Currently the RPMs are only available for Fedora 10. I'll build versions for Centos 5 over the next couple of days.</p> davorg 2009-03-31T08:02:06+00:00 journal libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20-enclosure.xml0000444000175000017500000000103612633540754023347 0ustar gregoagregoa Enclosure Demo Mon, 13 Oct 2008 03:45:39 -0400 Attachment/Enclosure Example Tue, 02 Nov 2004 09:44:33 -0500 description libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20-double.xml0000444000175000017500000000622112633540754022623 0ustar gregoagregoa tag:blogger.com,1999:blog-5910101498857524639 Sun, 24 Apr 2011 08:19:48 +0000 Perl for president our $blog = new Nice::Perl; http://niceperl.blogspot.com/ noreply@blogger.com (prz) Blogger 25 1 25 tag:blogger.com,1999:blog-5910101498857524639.post-5795437297335601353 Sun, 24 Apr 2011 08:08:00 +0000 2011-04-24T10:19:48.222+02:00 perl dancer cpan CPAN Module review - Web apps When I'm developing web applications, I use those frameworks that make my work easier. The size of the webs is not big and I have been working with <a href="http://search.cpan.org/perldoc?CGI::Application">CGI::Application</a> for years. In a recent search, I have found <a href="http://search.cpan.org/perldoc?Dancer">Dancer</a>. This framework handles the routes concept (an idea from <a href="http://www.sinatrarb.com/">Ruby's Sinatra</a>); routes are paths which are binded to code. For example:<br /><br /><table bgcolor="#f0f0f0" border="1" cellpadding="7" cellspacing="0"><tbody><tr><td><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b>get</b> '/home' =&gt; <b>sub</b> { 'Hi, this is home!' };</span></td></tr></tbody></table><br />There are a lot of plugins available (database, logging, session handling, REST, AJAX, validation, templates, WebSocket, ...) at CPAN. You can write your own plugin by subclassing <a href="http://search.cpan.org/perldoc?Dancer::Plugin">Dancer::Plugin</a>.<br /><br />The framework comes with a script that builds the skeleton of your application, with a nice structure in folders: views, libs, ... it takes seconds to start a new application.<br /><br />I &nbsp;definitely recommend <a href="http://search.cpan.org/perldoc?Dancer">Dancer</a> to you. Just install and try!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5910101498857524639-5795437297335601353?l=niceperl.blogspot.com' alt='' /></div> http://niceperl.blogspot.com/2011/04/cpan-module-review-web-apps.html noreply@blogger.com (prz) 0 libxml-feed-perl-0.53+dfsg.orig/t/samples/atom-multiple-categories.xml0000444000175000017500000000146212633540754025320 0ustar gregoagregoa Simon Wistow's blog 2008-12-09T06:37:07Z tag:vox.com,2006:6p00c2252555dbf219/ One Drink Too Many and a Joke Gone Too Far Test With Categories 2008-12-08T19:44:50Z 2008-12-09T06:37:07Z content libxml-feed-perl-0.53+dfsg.orig/t/samples/base_atom.xml0000444000175000017500000000225712633540754022341 0ustar gregoagregoa Sample Feed For documentation only Sample Toolkit First entry title tag:example.org,2004-04-20:/archives/000001.html 2004-04-19T07:45:00Z 2004-04-20T00:23:47Z 2004-04-20T11:56:34Z Mark Pilgrim ../about/ mark@example.org <p id="anchor1"><a href="#anchor2">skip to anchor 2</a></p> <p>Some content</p> <p id="anchor2">This is anchor 2</p> libxml-feed-perl-0.53+dfsg.orig/t/samples/rss-multiple-subjects.xml0000444000175000017500000000140312633540754024657 0ustar gregoagregoa Simon Wistow's blog http://deflatermouse.vox.com/library/posts/page/1/ Mon, 08 Dec 2008 11:44:50 -0800 Test With Categories Mon, 08 Dec 2008 11:44:50 -0800 content foo bar quux simon's tags libxml-feed-perl-0.53+dfsg.orig/t/samples/rss10-invalid-date.xml0000444000175000017500000000116112633540754023707 0ustar gregoagregoa First Weblog May 29, 2004 23:39:25 May 29, 2004 23:39:25 libxml-feed-perl-0.53+dfsg.orig/t/samples/rss10-double2.xml0000444000175000017500000000661412633540754022712 0ustar gregoagregoa RichardDawkins.net - All Content All original and aggregated news articles, audio and videos on RichardDawkins.net http://richarddawkins.net/archive/all_content/latest Neuroscientists uncover neural mechanisms of object recognition - - - medicalxpress.com <p><img src="http://s.ph-cdn.com/newman/gfx/news/2011/3-neuroscienti.jpg" width="300" class="articleImage" /><em>Certain brain injuries can cause people to lose the ability to visually recognize objects -- for example, confusing a harmonica for a cash register. Neuroscientists from Carnegie Mellon University and Princeton University examined the brain of a person with object agnosia, a deficit in the ability to recognize objects that does not include damage to the eyes or a general loss in intelligence, and have uncovered the neural mechanisms of object recognition. The results, published by Cell Press in the July 15th issue of the journal Neuron, describe the functional neuroanatomy of object agnosia and suggest that damage to the part of the brain critical for object recognition can have a widespread impact on remote parts of the cortex. These findings will force researchers to rethink basic assumptions of visual neuroscience. Credit: Carnegie Mellon University and Princeton University</em></p> <p><strong>Certain brain injuries can cause people to lose the ability to visually recognize objects — for example, confusing a harmonica for a cash register.</strong></p> <p>Neuroscientists from Carnegie Mellon University and Princeton University examined the brain of a person with object agnosia, a deficit in the ability to recognize objects that does not include damage to the eyes or a general loss in intelligence, and have uncovered the neural mechanisms of object recognition. The results, published by Cell Press in the July 15th issue of the journal Neuron, describe the functional neuroanatomy of object agnosia and suggest that damage to the part of the brain critical for object recognition can have a widespread impact on remote parts of the cortex.<br> <a href="http://medicalxpress.com/news/2011-07-neuroscientists-uncover-neural-mechanisms-recognition.html#share">Read more and watch video</a></p> Thu, 14 Jul 2011 14:36:55 +0000 http://richarddawkins.net/videos/642152-neuroscientists-uncover-neural-mechanisms-of-object-recognition http://richarddawkins.net/videos/642152-neuroscientists-uncover-neural-mechanisms-of-object-recognition Medicine libxml-feed-perl-0.53+dfsg.orig/t/samples/rss10.xml0000444000175000017500000000343012633540754021351 0ustar gregoagregoa First Weblog http://localhost/weblog/ This is a test weblog. en-us Melody 2004-05-29T23:39:57-08:00 Entry Two http://localhost/weblog/2004/05/entry_two.html Hello!... Hello!

]]>
Travel Melody 2004-05-29T23:39:25-08:00
Test http://localhost/weblog/2004/05/test.html This is a test. Why don't you come down to our place for a coffee and a chat?... This is a test.

Why don't you come down to our place for a coffee and a chat?

]]>
Sports Melody 2004-05-08T23:03:28-08:00
libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20-multi-enclosure.xml0000444000175000017500000000117212633540754024500 0ustar gregoagregoa Enclosure Demo Mon, 13 Oct 2008 03:45:39 -0400 Attachment/Enclosure Example Tue, 02 Nov 2004 09:44:33 -0500 description libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20.xml0000444000175000017500000000257312633540754021361 0ustar gregoagregoa First Weblog http://localhost/weblog/ This is a test weblog. en-us Copyright 2004 Sat, 29 May 2004 23:39:25 -0800 Sat, 29 May 2004 23:39:57 -0800 http://www.movabletype.org/?v=3.0D http://blogs.law.harvard.edu/tech/rss Melody Entry Two Hello!... Hello!

]]>
http://localhost/weblog/2004/05/entry_two.html Melody http://localhost/weblog/2004/05/entry_two.html Travel Sat, 29 May 2004 23:39:25 -0800
Test This is a test. Why don't you come down to our place for a coffee and a chat?... This is a test.

Why don't you come down to our place for a coffee and a chat?

]]>
http://localhost/weblog/2004/05/test.html http://localhost/weblog/2004/05/test.html Sports Sat, 08 May 2004 23:03:28 -0800
libxml-feed-perl-0.53+dfsg.orig/t/samples/rss-multiple-categories.xml0000444000175000017500000000136312633540754025167 0ustar gregoagregoa Simon Wistow's blog http://deflatermouse.vox.com/library/posts/page/1/ Mon, 08 Dec 2008 11:44:50 -0800 Test With Categories Mon, 08 Dec 2008 11:44:50 -0800 content foo bar quux simon's tags libxml-feed-perl-0.53+dfsg.orig/t/samples/atom-enclosure.xml0000444000175000017500000000064712633540754023345 0ustar gregoagregoa Enclosure Demo 2008-10-13T07:45:39Z Attachment/Enclosure Example 2004-11-02T14:44:33 description libxml-feed-perl-0.53+dfsg.orig/t/samples/base_rss.xml0000444000175000017500000000073612633540754022210 0ustar gregoagregoa Sample Feed index.html First entry title 000001.html (relative, fully-qualified) libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20-no-summary.xml0000444000175000017500000000100312633540754023451 0ustar gregoagregoa First Weblog http://localhost/weblog/ This is a test weblog. Test <p>This is a test.</p> <p>Why don't you come down to our place for a coffee and a <strong>chat</strong>?</p> http://localhost/weblog/2004/05/test.html libxml-feed-perl-0.53+dfsg.orig/t/samples/atom.xml0000444000175000017500000000354112633540754021344 0ustar gregoagregoa First Weblog 2004-05-30T07:39:57Z This is a test weblog. tag:localhost,2004:/weblog//1 Movable Type Copyright (c) 2004, Melody Melody Entry Two 2004-05-30T07:39:53Z 2004-05-30T07:39:25Z tag:localhost,2004:/weblog//1.28 2004-05-30T07:39:25Z Hello!... Melody melody@example.com Travel Hello!

]]>
Test 2004-05-30T06:24:08Z 2004-05-09T07:03:28Z tag:localhost,2004:/weblog//1.1 2004-05-09T07:03:28Z This is a test. Why don't you come down to our place for a coffee and a chat?... Melody melody@example.com Sports This is a test.

Why don't you come down to our place for a coffee and a chat?

]]>
libxml-feed-perl-0.53+dfsg.orig/t/samples/atom-10-example.xml0000444000175000017500000000107212633540754023210 0ustar gregoagregoa Example Feed 2003-12-13T18:30:02Z John Doe urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6 Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text. libxml-feed-perl-0.53+dfsg.orig/t/samples/rss20-p.xml0000444000175000017500000000122212633540754021604 0ustar gregoagregoa Some title http://creograf.ru/blog/4progr ammer Some desc ru-ru Sun, 3 Apr 2011 05:42:15 +0300 Sun, 3 Apr 2011 05:42:15 +0300 Some entryi http://creograf.ru/post/regexp -js Sun, 3 Apr 2011 05:42:12 +0300 libxml-feed-perl-0.53+dfsg.orig/lib/0000755000175000017500000000000012633540754016520 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/0000755000175000017500000000000012633540754017160 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed.pm0000444000175000017500000003025312633540754020362 0ustar gregoagregoapackage XML::Feed; use strict; use warnings; use base qw( Class::ErrorHandler ); use Feed::Find; use URI::Fetch; use LWP::UserAgent; use Carp; use Scalar::Util 'blessed'; use Module::Pluggable search_path => "XML::Feed::Format", require => 1, sub_name => 'formatters'; our $VERSION = '0.53'; our $MULTIPLE_ENCLOSURES = 0; our @formatters; BEGIN { @formatters = __PACKAGE__->formatters; } sub new { my $class = shift; my $format = shift || 'Atom'; my $format_class = 'XML::Feed::Format::' . $format; eval "use $format_class"; Carp::croak("Unsupported format $format: $@") if $@; my $feed = bless {}, join('::', __PACKAGE__, "Format", $format); $feed->init_empty(@_) or return $class->error($feed->errstr); $feed; } sub init_empty { 1 } sub parse { my $class = shift; my($stream, $specified_format) = @_; return $class->error("Stream parameter is required") unless $stream; my $feed = bless {}, $class; my $xml = ''; if (blessed($stream) and $stream->isa('URI')) { my $ua = LWP::UserAgent->new; $ua->agent(__PACKAGE__ . "/$VERSION"); $ua->env_proxy; # force allowing of proxies my $res = URI::Fetch->fetch($stream, UserAgent => $ua) or return $class->error(URI::Fetch->errstr); return $class->error("This feed has been permanently removed") if $res->status == URI::Fetch::URI_GONE(); $xml = $res->content; } elsif (ref($stream) eq 'SCALAR') { $xml = $$stream; } elsif (ref($stream)) { while (read($stream, my($chunk), 8192)) { $xml .= $chunk; } } else { open my $fh, $stream or return $class->error("Can't open $stream: $!"); while (read $fh, my($chunk), 8192) { $xml .= $chunk; } close $fh; } return $class->error("Can't get feed XML content from $stream") unless $xml; my $format; if ($specified_format) { $format = $specified_format; } else { $format = $feed->identify_format(\$xml) or return $class->error($feed->errstr); } my $format_class = join '::', __PACKAGE__, "Format", $format; eval "use $format_class"; return $class->error("Unsupported format $format: $@") if $@; bless $feed, $format_class; $feed->init_string(\$xml) or return $class->error($feed->errstr); $feed; } sub identify_format { my $feed = shift; my($xml) = @_; foreach my $class (@formatters) { my ($name) = ($class =~ m!([^:]+)$!); # TODO ugly my $tmp = $$xml; return $name if eval { $class->identify(\$tmp) }; return $feed->error($@) if $@; } return $feed->error("Cannot detect feed type"); } sub _get_first_tag { my $class = shift; my ($xml) = @_; ## Auto-detect feed type based on first element. This is prone ## to breakage, but then again we don't want to parse the whole ## feed ourselves. my $tag; while ($$xml =~ /<(\S+)/sg) { (my $t = $1) =~ tr/a-zA-Z0-9:\-\?!//cd; my $first = substr $t, 0, 1; $tag = $t, last unless $first eq '?' || $first eq '!'; } die ("Cannot find first element") unless $tag; $tag =~ s/^.*://; return $tag; } sub find_feeds { my $class = shift; my($uri) = @_; my @feeds = Feed::Find->find($uri) or return $class->error(Feed::Find->errstr); @feeds; } sub convert { my $feed = shift; my($format) = @_; my $new = XML::Feed->new($format); for my $field (qw( title link description language author copyright modified generator )) { my $val = $feed->$field(); next unless defined $val; $new->$field($val); } for my $entry ($feed->entries) { $new->add_entry($entry->convert($format)); } $new; } sub splice { my $feed = shift; my($other) = @_; my %ids = map { $_->id => 1 } $feed->entries; for my $entry ($other->entries) { $feed->add_entry($entry) unless $ids{$entry->id}++; } } sub _convert_entry { my $feed = shift; my $entry = shift; my $feed_format = ref($feed); $feed_format =~ s!^XML::Feed::Format::!!; my $entry_format = ref($entry); $entry_format =~ s!^XML::Feed::Entry::Format::!!; return $entry if $entry_format eq $feed_format; return $entry->convert($feed_format); } sub base; sub format; sub title; sub link; sub self_link; sub description; sub language; sub author; sub copyright; sub modified; sub generator; sub add_entry; sub entries; sub as_xml; sub id; sub image; sub tagline { shift->description(@_) } sub items { $_[0]->entries } # RFC 5005 sub first_link; sub last_link; sub previous_link; sub next_link; sub current_link; sub prev_archive_link; sub next_archive_link; 1; __END__ =head1 NAME XML::Feed - Syndication feed parser and auto-discovery =head1 SYNOPSIS use XML::Feed; my $feed = XML::Feed->parse(URI->new('http://example.com/atom.xml')) or die XML::Feed->errstr; print $feed->title, "\n"; for my $entry ($feed->entries) { } ## Find all of the syndication feeds on a given page, using ## auto-discovery. my @feeds = XML::Feed->find_feeds('http://example.com/'); =head1 DESCRIPTION I is a syndication feed parser for both RSS and Atom feeds. It also implements feed auto-discovery for finding feeds, given a URI. I supports the following syndication feed formats: =over 4 =item * RSS 0.91 =item * RSS 1.0 =item * RSS 2.0 =item * Atom =back The goal of I is to provide a unified API for parsing and using the various syndication formats. The different flavors of RSS and Atom handle data in different ways: date handling; summaries and content; escaping and quoting; etc. This module attempts to remove those differences by providing a wrapper around the formats and the classes implementing those formats (L and L). For example, dates are handled differently in each of the above formats. To provide a unified API for date handling, I converts all date formats transparently into L objects, which it then returns to the caller. =head1 USAGE =head2 XML::Feed->new($format) Creates a new empty I object using the format I<$format>. $feed = XML::Feed->new('Atom'); $feed = XML::Feed->new('RSS'); $feed = XML::Feed->new('RSS', version => '0.91'); =head2 XML::Feed->parse($stream) =head2 XML::Feed->parse($stream, $format) Parses a syndication feed identified by I<$stream> and returns an I object. I<$stream> can be any one of the following: =over 4 =item * Scalar reference A reference to string containing the XML body of the feed. =item * Filehandle An open filehandle from which the feed XML will be read. =item * File name The name of a file containing the feed XML. =item * URI object A URI from which the feed XML will be retrieved. =back I<$format> allows you to override format guessing. =head2 XML::Feed->find_feeds($uri) Given a URI I<$uri>, use auto-discovery to find all of the feeds linked from that page (using IlinkE> tags). Returns a list of feed URIs. =head2 XML::Feed->identify_format(\$xml) Given the xml of a feed return what format it is in, with C or C for all versions of RSS. Note that you pass in a scalar ref to the xml string. =head2 $feed->convert($format) Converts the I object into the I<$format> format, and returns the new object. =head2 $feed->splice($other_feed) Splices in all of the entries from the feed I<$other_feed> into I<$feed>, skipping posts that are already in I<$feed>. =head2 $feed->format Returns the format of the feed (C, or some version of C). =head2 $feed->title([ $title ]) The title of the feed/channel. =head2 $feed->base([ $base ]) The url base of the feed/channel. =head2 $feed->link([ $uri ]) The permalink of the feed/channel. =head2 $feed->tagline([ $tagline ]) The description or tagline of the feed/channel. =head2 $feed->description([ $description ]) Alias for I<$feed-Etagline>. =head2 $feed->author([ $author ]) The author of the feed/channel. =head2 $feed->language([ $language ]) The language of the feed. =head2 $feed->copyright([ $copyright ]) The copyright notice of the feed. =head2 $feed->modified([ $modified ]) A I object representing the last-modified date of the feed. If present, I<$modified> should be a I object. =head2 $feed->generator([ $generator ]) The generator of the feed. =head2 $feed->self_link ([ $uri ]) The Atom Self-link of the feed: L A string. =head2 $feed->entries A list of the entries/items in the feed. Returns an array containing L objects. =head2 $feed->items A synonym (alias) for <$feed-Eentries>. =head2 $feed->add_entry($entry) Adds an entry to the feed. I<$entry> should be an L object in the correct format for the feed. =head2 $feed->as_xml Returns an XML representation of the feed, in the format determined by the current format of the I<$feed> object. =head2 $feed->first_link ([ $uri ]) The Atom First-link for feed paging and archiving (RFC 5005). L =head2 $feed->last_link ([ $uri ]) The Atom Last-link for feed paging and archiving. =head2 $feed->next_link ([ $uri ]) The Atom Next-link for feed paging and archiving. =head2 $feed->previous_link ([ $uri ]) The Atom Previous-link for feed paging and archiving. =head2 $feed->current_link ([ $uri ]) The Atom Current-link for feed paging and archiving. =head2 $feed->next_archive_link ([ $uri ]) The Atom Next-link for feed paging and archiving. =head2 $feed->prev_archive_link ([ $uri ]) The Atom Prev-Archive-link for feed paging and archiving. =head1 PACKAGE VARIABLES =over 4 =item C<$XML::Feed::Format::RSS::PREFERRED_PARSER> If you want to use another RSS parser class than XML::RSS (default), you can change the class by setting C<$PREFERRED_PARSER> variable in the XML::Feed::Format::RSS package. $XML::Feed::Format::RSS::PREFERRED_PARSER = "XML::RSS::LibXML"; B this will only work for parsing feeds, not creating feeds. B Only C version 0.3004 is known to work at the moment. =item C<$XML::Feed::MULTIPLE_ENCLOSURES> Although the RSS specification states that there can be at most one enclosure per item some feeds break this rule. If this variable is set then C captures all of them and makes them available as a list. Otherwise it returns the last enclosure parsed. B C version 1.44 is needed for this to work. =back =cut =head1 VALID FEEDS For reference, this cgi script will create valid, albeit nonsensical feeds (according to C anyway) for Atom 1.0 and RSS 0.90, 0.91, 1.0 and 2.0. #!perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use DateTime; use XML::Feed; my $cgi = CGI->new; my @args = ( $cgi->param('format') || "Atom" ); push @args, ( version => $cgi->param('version') ) if $cgi->param('version'); my $feed = XML::Feed->new(@args); $feed->id("http://".time.rand()."/"); $feed->title('Test Feed'); $feed->link($cgi->url); $feed->self_link($cgi->url( -query => 1, -full => 1, -rewrite => 1) ); $feed->modified(DateTime->now); my $entry = XML::Feed::Entry->new(); $entry->id("http://".time.rand()."/"); $entry->link("http://example.com"); $entry->title("Test entry"); $entry->summary("Test summary"); $entry->content("Foo"); $entry->modified(DateTime->now); $entry->author('test@example.com (Testy McTesterson)'); $feed->add_entry($entry); my $mime = ("Atom" eq $feed->format) ? "application/atom+xml" : "application/rss+xml"; print $cgi->header($mime); print $feed->as_xml; =head1 LICENSE I is free software; you may redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR & COPYRIGHT Except where otherwise noted, I is Copyright 2004-2008 Six Apart. All rights reserved. =head1 SUPPORT For support contact the XML::Feed mailing list - xml-feed@perlhacks.com. =head1 SOURCE CODE The latest version of I can be found at http://github.com/davorg/XML-Feed =cut libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/0000755000175000017500000000000012633540754020023 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Enclosure.pm0000444000175000017500000000225612633540754022323 0ustar gregoagregoapackage XML::Feed::Enclosure; use strict; use warnings; our $VERSION = '0.53'; use base qw( Class::ErrorHandler ); sub wrap { my $class = shift; my($c) = @_; bless { %$c }, $class; } *new = \&wrap; sub _var { my $enclosure = shift; my $var = shift; $enclosure->{$var} = shift if @_; $enclosure->{$var}; } sub type { shift->_var('type', @_) } sub length { shift->_var('length', @_) } sub url { shift->_var('url', @_) } 1; __END__ =head1 NAME XML::Feed::Enclosure - Wrapper for enclosure objects =head1 SYNOPSIS my ($enclosure) = $entry->enclosure; print $enclosure->type; =head1 DESCRIPTION I represents a content object in an I entry in a syndication feed. =head1 USAGE =head2 wrap Take params and turn them into a I object. =head2 new A synonym for I. =head2 $enclosure->url The url of the object. =head2 $enclosure->type The MIME type of the item referred to in I. =head2 $enclosure->length The length of object refereed to in I =head1 AUTHOR & COPYRIGHT Please see the I manpage for author, copyright, and license information. =cut libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Entry.pm0000444000175000017500000001054412633540754021464 0ustar gregoagregoapackage XML::Feed::Entry; use strict; use warnings; our $VERSION = '0.53'; use base qw( Class::ErrorHandler ); use Scalar::Util qw( blessed ); use Carp; sub wrap { my $class = shift; my($item) = @_; bless { entry => $item }, $class; } sub unwrap { $_[0]->{entry} } sub new { my $class = shift; my($format) = @_; $format ||= 'Atom'; my $format_class = 'XML::Feed::Format::' . $format; eval "use $format_class"; Carp::croak("Unsupported format $format: $@") if $@; my $entry = bless {}, join('::', __PACKAGE__, "Format", $format); $entry->init_empty or return $class->error($entry->errstr); $entry; } sub init_empty { 1 } sub convert { my $entry = shift; my($format) = @_; my $new = __PACKAGE__->new($format); for my $field (qw( title link content summary author id issued modified lat long )) { my $val = $entry->$field(); next unless defined $val; next if blessed $val && $val->isa('XML::Feed::Content') && ! defined $val->body; $new->$field($val); } for my $field (qw( category )) { my @val = $entry->$field(); next unless @val; $new->$field(@val); } $new; } sub title; sub link; sub content; sub summary; sub category; sub author; sub id; sub issued; sub modified; sub lat; sub long; sub format; sub tags { shift->category(@_) } sub enclosure; 1; __END__ =head1 NAME XML::Feed::Entry - Entry/item in a syndication feed =head1 SYNOPSIS ## $feed is an XML::Feed object. for my $entry ($feed->entries) { print $entry->title, "\n", $entry->summary, "\n\n"; } =head1 DESCRIPTION I represents an entry/item in an L syndication feed. =head1 USAGE =head2 XML::Feed::Entry->new($format) Creates a new I object in the format I<$format>, which should be either I or I. =head2 $entry->convert($format) Converts the I object into the I<$format> format, and returns the new object. =head2 $entry->title([ $title ]) The title of the entry. =head2 $entry->base([ $base ]) The url base of the entry. =head2 $entry->link([ $uri ]) The permalink of the entry, in most cases, except in cases where it points instead to an offsite URI referenced in the entry. =head2 $entry->content([ $content ]) An L object representing the full entry body, or as much as is available in the feed. In RSS feeds, this method will look first for L and L elements, then fall back to a IdescriptionE> element. =head2 $entry->summary([ $summary ]) An L object representing a short summary of the entry. Possibly. Since RSS feeds do not have the idea of a summary separate from the entry body, this may not always be what you want. If the entry contains both a IdescriptionE> element B another element typically used for the full content of the entry--either I or L--we treat that as the summary. Otherwise, we assume that there isn't a summary, and return an L object with an empty string in the I. =head2 $entry->category([ $category ]) The category in which the entry was posted. Returns a list of categories if called in array context or the first category if called in scalar context. B It's possible this API might change to have an I instead. =head2 $entry->tags([ $tag ]) A synonym (alias) for I; =head2 $entry->author([ $author ]) The name or email address of the person who posted the entry. =head2 $entry->id([ $id ]) The unique ID of the entry. =head2 $entry->issued([ $issued ]) A I object representing the date and time at which the entry was posted. If present, I<$issued> should be a I object. =head2 $entry->modified([ $modified ]) A I object representing the last-modified date of the entry. If present, I<$modified> should be a I object. =head2 $entry->wrap Take an entry in its native format and turn it into an I object. =head2 $entry->unwrap Take an I object and turn it into its native format. =head1 AUTHOR & COPYRIGHT Please see the I manpage for author, copyright, and license information. =cut libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Content.pm0000444000175000017500000000276312633540754022001 0ustar gregoagregoapackage XML::Feed::Content; use strict; use warnings; our $VERSION = '0.53'; use base qw( Class::ErrorHandler ); sub wrap { my $class = shift; my($c) = @_; bless { %$c }, $class; } *new = \&wrap; sub _var { my $content = shift; my $var = shift; $content->{$var} = shift if @_; $content->{$var}; } sub type { shift->_var('type', @_) } sub body { shift->_var('body', @_) } sub base { shift->_var('base', @_) } 1; __END__ =head1 NAME XML::Feed::Content - Wrapper for content objects =head1 SYNOPSIS my $content = $entry->content; print $content->body; =head1 DESCRIPTION I represents a content object in an I entry in a syndication feed. This could be a IdescriptionE> element in an RSS feed, a IcontentE> element in an Atom feed, etc. In other words, any element where knowing both the actual data and the B of data is useful. =head1 USAGE =head2 wrap Take params and turn them into a I object. =head2 new A synonym for I. =head2 $content->body The actual data. =head2 $content->type The MIME type of the content in I. This is really only useful in Atom feeds, because RSS feeds do not specify the type of content included in an entry. In RSS feeds, generally the MIME type defaults to I. =head2 $content->base The url base of the content. =head1 AUTHOR & COPYRIGHT Please see the I manpage for author, copyright, and license information. =cut libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Format/0000755000175000017500000000000012633540754021253 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Format/Atom.pm0000444000175000017500000000731312633540754022513 0ustar gregoagregoapackage XML::Feed::Format::Atom; use strict; use warnings; our $VERSION = '0.53'; use base qw( XML::Feed ); use XML::Atom::Feed; use XML::Atom::Util qw( iso2dt ); use List::Util qw( first ); use DateTime::Format::W3CDTF; use HTML::Entities; use XML::Atom::Entry; XML::Atom::Entry->mk_elem_accessors(qw( lat long ), ['http://www.w3.org/2003/01/geo/wgs84_pos#']); use XML::Atom::Content; use XML::Feed::Entry::Format::Atom; sub identify { my $class = shift; my $xml = shift; my $tag = $class->_get_first_tag($xml); return ($tag eq 'feed'); } sub init_empty { my ($feed, %args) = @_; $args{'Version'} ||= '1.0'; $feed->{atom} = XML::Atom::Feed->new(%args); $feed; } sub init_string { my $feed = shift; my($str) = @_; if ($str) { $feed->{atom} = XML::Atom::Feed->new(Stream => $str) or return $feed->error(XML::Atom::Feed->errstr); } $feed; } sub format { 'Atom' } sub title { shift->{atom}->title(@_) } sub link { my $feed = shift; if (@_) { $feed->{atom}->add_link({ rel => 'alternate', href => $_[0], type => 'text/html', }); } else { my $l = first { !defined $_->rel || $_->rel eq 'alternate' } $feed->{atom}->link; $l ? $l->href : undef; } } sub _rel_link { my $feed = shift; my $rel = shift; if (@_) { my $uri = shift; $feed->{atom}->add_link({type => "application/atom+xml", rel => $rel, href => $uri}); return $uri; } else { my $l; if ($rel eq 'self') { $l = first { !defined $_->rel || $_->rel eq 'self' } $feed->{atom}->link; ; } else { $l = first { !defined $_->rel || $_->rel eq $rel } $feed->{atom}->link; ; } return $l ? $l->href : undef; } } sub self_link { shift->_rel_link( 'self', @_ ) } sub first_link { shift->_rel_link( 'first', @_ ) } sub last_link { shift->_rel_link( 'last', @_ ) } sub next_link { shift->_rel_link( 'next', @_ ) } sub previous_link { shift->_rel_link( 'previous', @_ ) }; sub current_link { shift->_rel_link( 'current', @_ ) } sub prev_archive_link { shift->_rel_link( 'prev-archive', @_ ) } sub next_archive_link { shift->_rel_link( 'next-archive', @_ ) } sub description { shift->{atom}->tagline(@_) } sub copyright { shift->{atom}->copyright(@_) } sub language { shift->{atom}->language(@_) } sub generator { shift->{atom}->generator(@_) } sub id { shift->{atom}->id(@_) } sub updated { shift->{atom}->updated(@_) } sub add_link { shift->{atom}->add_link(@_) } sub base { shift->{atom}->base(@_) } sub author { my $feed = shift; if (@_ && $_[0]) { my $person = XML::Atom::Person->new(Version => 1.0); $person->name($_[0]); $feed->{atom}->author($person); } else { $feed->{atom}->author ? $feed->{atom}->author->name : undef; } } sub image { return; } sub modified { my $feed = shift; if (@_) { $feed->{atom}->modified(DateTime::Format::W3CDTF->format_datetime($_[0])); } else { return iso2dt($feed->{atom}->modified) if $feed->{atom}->modified; return iso2dt($feed->{atom}->updated) if $feed->{atom}->updated; return undef; } } sub entries { my @entries; for my $entry ($_[0]->{atom}->entries) { push @entries, XML::Feed::Entry::Format::Atom->wrap($entry); } @entries; } sub add_entry { my $feed = shift; my $entry = shift || return; $entry = $feed->_convert_entry($entry); $feed->{atom}->add_entry($entry->unwrap); } sub as_xml { $_[0]->{atom}->as_xml } 1; libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Format/RSS.pm0000444000175000017500000001163312633540754022262 0ustar gregoagregoapackage XML::Feed::Format::RSS; use strict; use warnings; our $VERSION = '0.53'; use base qw( XML::Feed ); use DateTime::Format::Mail; use DateTime::Format::W3CDTF; use XML::Atom::Util qw(iso2dt); use XML::Feed::Enclosure; use XML::Feed::Entry::Format::RSS; our $PREFERRED_PARSER = "XML::RSS"; sub identify { my $class = shift; my $xml = shift; my $tag = $class->_get_first_tag($xml); return ($tag eq 'rss' || $tag eq 'RDF'); } sub init_empty { my ($feed, %args) = @_; $args{'version'} ||= '2.0'; eval "use $PREFERRED_PARSER"; die $@ if $@; $feed->{rss} = $PREFERRED_PARSER->new(%args); $feed->{rss}->add_module(prefix => "content", uri => 'http://purl.org/rss/1.0/modules/content/'); $feed->{rss}->add_module(prefix => "dcterms", uri => 'http://purl.org/dc/terms/'); $feed->{rss}->add_module(prefix => "atom", uri => 'http://www.w3.org/2005/Atom'); $feed->{rss}->add_module(prefix => "geo", uri => 'http://www.w3.org/2003/01/geo/wgs84_pos#'); $feed; } sub init_string { my $feed = shift; my($str) = @_; $feed->init_empty; my $opts = { hashrefs_instead_of_strings => 1, }; $opts->{allow_multiple} = [ 'enclosure' ] if $XML::Feed::MULTIPLE_ENCLOSURES; if ($str) { $feed->{rss}->parse($$str, $opts ); } $feed; } sub format { 'RSS ' . $_[0]->{rss}->{'version'} } ## The following elements are the same in all versions of RSS. sub title { shift->{rss}->channel('title', @_) } sub link { my $link = shift->{rss}->channel('link', @_); $link =~ s/^\s+//; $link =~ s/\s+$//; return $link; } sub description { shift->{rss}->channel('description', @_) } sub updated { shift->modified(@_) } # This doesn't exist in RSS sub id { } ## This is RSS 2.0 only--what's the equivalent in RSS 1.0? sub copyright { shift->{rss}->channel('copyright', @_) } sub base { my $feed = shift; if (@_) { $feed->{rss}->{'xml:base'} = $_[0]; } else { $feed->{rss}->{'xml:base'}; } } ## The following all work transparently in any RSS version. sub language { my $feed = shift; if (@_) { $feed->{rss}->channel('language', $_[0]); $feed->{rss}->channel->{dc}{language} = $_[0]; } else { $feed->{rss}->channel('language') || $feed->{rss}->channel->{dc}{language}; } } sub self_link { my $feed = shift; if (@_) { my $uri = shift; $feed->{rss}->channel->{'atom'}{'link'} = { rel => "self", href => $uri, type => "application/rss+xml", }; } return $feed->{rss}->channel->{'atom'}{'link'}; } # This doesn't exist in RSS sub first_link { }; sub last_link { }; sub previous_link { }; sub next_link { }; sub current_link { }; sub prev_archive_link { }; sub next_archive_link { }; sub generator { my $feed = shift; if (@_) { $feed->{rss}->channel('generator', $_[0]); $feed->{rss}->channel->{'http://webns.net/mvcb/'}{generatorAgent} = $_[0]; } else { $feed->{rss}->channel('generator') || $feed->{rss}->channel->{'http://webns.net/mvcb/'}{generatorAgent}; } } sub author { my $feed = shift; if (@_) { $feed->{rss}->channel('webMaster', $_[0]); $feed->{rss}->channel->{dc}{creator} = $_[0]; } else { $feed->{rss}->channel('webMaster') || $feed->{rss}->channel->{dc}{creator}; } } sub modified { my $rss = shift->{rss}; if (@_) { $rss->channel('pubDate', DateTime::Format::Mail->format_datetime($_[0])); ## XML::RSS is so weird... if I set this, it will try to use ## the value for the lastBuildDate, which I don't want--because ## this date is formatted for an RSS 1.0 feed. So it's commented out. #$rss->channel->{dc}{date} = # DateTime::Format::W3CDTF->format_datetime($_[0]); } else { my $date; eval { if (my $ts = $rss->channel('pubDate')) { $ts =~ s/^\s+//; $ts =~ s/\s+$//; $date = DateTime::Format::Mail->parse_datetime($ts); } elsif ($ts = $rss->channel->{dc}{date}) { $ts =~ s/^\s+//; $ts =~ s/\s+$//; $date = DateTime::Format::W3CDTF->parse_datetime($ts); } }; return $date; } } sub image { my $self = shift; my $rss = $self->{rss}; return @_ ? $rss->image(@_) : $rss->image('url'); } sub entries { my $rss = $_[0]->{rss}; my @entries; for my $item (@{ $rss->{items} }) { push @entries, XML::Feed::Entry::Format::RSS->wrap($item); $entries[-1]->{_version} = $rss->{'version'}; } @entries; } sub add_entry { my $feed = shift; my $entry = shift || return; $entry = $feed->_convert_entry($entry); $feed->{rss}->add_item(%{ $entry->unwrap }); } sub as_xml { $_[0]->{rss}->as_string } 1; libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Entry/0000755000175000017500000000000012633540754021124 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Entry/Format/0000755000175000017500000000000012633540754022354 5ustar gregoagregoalibxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Entry/Format/Atom.pm0000444000175000017500000001354212633540754023615 0ustar gregoagregoapackage XML::Feed::Entry::Format::Atom; use strict; use warnings; our $VERSION = '0.53'; use base qw( XML::Feed::Entry ); use XML::Atom::Util qw( iso2dt ); use XML::Feed::Content; use XML::Atom::Entry; use List::Util qw( first ); sub init_empty { my $entry = shift; $entry->{entry} = XML::Atom::Entry->new(Version => 1.0); 1; } sub format { 'Atom' } sub title { shift->{entry}->title(@_) } sub source { shift->{entry}->source(@_) } sub updated { shift->{entry}->updated(@_) } sub base { shift->{entry}->base(@_) } sub link { my $entry = shift; if (@_) { $entry->{entry}->add_link({ rel => 'alternate', href => $_[0], type => 'text/html', }); } else { my $l = first { !defined $_->rel || $_->rel eq 'alternate' } $entry->{entry}->link; $l ? $l->href : undef; } } sub summary { my $entry = shift; if (@_) { my %param; if (ref($_[0]) eq 'XML::Feed::Content') { %param = (Body => $_[0]->body); } else { %param = (Body => $_[0]); } $entry->{entry}->summary(XML::Atom::Content->new(%param, Version => 1.0)); } else { my $s = $entry->{entry}->summary; # map Atom types to MIME types my $type = ($s && ref($s) eq 'XML::Feed::Content') ? $s->type : undef; if ($type) { $type = 'text/html' if $type eq 'xhtml' || $type eq 'html'; $type = 'text/plain' if $type eq 'text'; } my $body = $s; if (defined $s && ref($s) eq 'XML::Feed::Content') { $body = $s->body; } XML::Feed::Content->wrap({ type => $type, body => $body }); } } my %types = ( 'text/xhtml' => 'xhtml', 'text/html' => 'html', 'text/plain' => 'text', ); sub content { my $entry = shift; if (@_) { my %param; my $base; my $orig_body; if (ref($_[0]) eq 'XML::Feed::Content') { $orig_body = $_[0]->body; if (defined $_[0]->type && defined $types{$_[0]->type}) { %param = (Body => $orig_body, Type => $types{$_[0]->type}); if ($param{'Type'} eq "html") { $param{'Body'} = HTML::Entities::encode_entities($param{'Body'}); } } else { } $base = $_[0]->base if defined $_[0]->base; } else { $orig_body = $_[0]; } if (!exists($param{Body})) { $param{Body} = $orig_body; } $entry->{entry}->content(XML::Atom::Content->new(%param, Version => 1.0)); # Assigning again so the type will be normalized. This seems to be # an XML-Atom do-what-I-don't-meannery. $entry->{entry}->content->body($orig_body); $entry->{entry}->content->base($base) if defined $base; } else { my $c = $entry->{entry}->content; # map Atom types to MIME types my $type = $c ? $c->type : undef; if ($type) { $type = 'text/html' if $type eq 'xhtml' || $type eq 'html'; $type = 'text/plain' if $type eq 'text'; } XML::Feed::Content->wrap({ type => $type, base => $c ? $c->base : undef, body => $c ? $c->body : undef }); } } sub category { my $entry = shift; my $ns = XML::Atom::Namespace->new(dc => 'http://purl.org/dc/elements/1.1/'); if (@_) { $entry->{entry}->add_category({ term => $_ }) for @_; return 1 } else { my @category = ($entry->{entry}->can('categories')) ? $entry->{entry}->categories : $entry->{entry}->category; my @return = @category ? (map { $_->label || $_->term } @category) : $entry->{entry}->getlist($ns, 'subject'); return wantarray? @return : $return[0]; } } sub author { my $entry = shift; if (@_ && $_[0]) { my $person = XML::Atom::Person->new(Version => 1.0); $person->name($_[0]); $entry->{entry}->author($person); } else { $entry->{entry}->author ? $entry->{entry}->author->name : undef; } } sub id { shift->{entry}->id(@_) } sub issued { my $entry = shift; if (@_) { $entry->{entry}->issued(DateTime::Format::W3CDTF->format_datetime($_[0])) if $_[0]; } else { return iso2dt($entry->{entry}->issued) if $entry->{entry}->issued; return iso2dt($entry->{entry}->published) if $entry->{entry}->published; return undef; } } sub modified { my $entry = shift; if (@_) { $entry->{entry}->modified(DateTime::Format::W3CDTF->format_datetime($_[0])) if $_[0]; } else { return iso2dt($entry->{entry}->modified) if $entry->{entry}->modified; return iso2dt($entry->{entry}->updated) if $entry->{entry}->updated; return undef; } } sub lat { my $entry = shift; if (@_) { $entry->{entry}->lat($_[0]) if $_[0]; } else { $entry->{entry}->lat; } } sub long { my $entry = shift; if (@_) { $entry->{entry}->long($_[0]) if $_[0]; } else { $entry->{entry}->long; } } sub enclosure { my $entry = shift; if (@_) { my $enclosure = shift; my $method = ($XML::Feed::MULTIPLE_ENCLOSURES)? 'add_link' : 'link'; $entry->{entry}->$method({ rel => 'enclosure', href => $enclosure->{url}, length => $enclosure->{length}, type => $enclosure->{type} }); return 1; } else { my @links = grep { defined $_->rel && $_->rel eq 'enclosure' } $entry->{entry}->link; return unless @links; my @encs = map { XML::Feed::Enclosure->new({ url => $_->href, length => $_->length, type => $_->type }) } @links ; return ($XML::Feed::MULTIPLE_ENCLOSURES)? @encs : $encs[-1]; } } 1; libxml-feed-perl-0.53+dfsg.orig/lib/XML/Feed/Entry/Format/RSS.pm0000444000175000017500000001443512633540754023366 0ustar gregoagregoapackage XML::Feed::Entry::Format::RSS; use strict; use warnings; our $VERSION = '0.53'; sub format { 'RSS ' . $_[0]->{'_version'} } use XML::Feed::Content; use base qw( XML::Feed::Entry ); sub init_empty { $_[0]->{entry} = { } } sub base { my $entry = shift; @_ ? $entry->{entry}->{'xml:base'} = $_[0] : $entry->{entry}->{'xml:base'}; } sub title { my $entry = shift; @_ ? $entry->{entry}{title} = $_[0] : $entry->{entry}{title}; } sub link { my $entry = shift; if (@_) { $entry->{entry}{link} = $_[0]; ## For RSS 2.0 output from XML::RSS. Sigh. $entry->{entry}{permaLink} = $_[0]; } else { my $link = $entry->{entry}{link} || $entry->{entry}{permaLink} || $entry->{entry}{guid}; if (defined $link) { $link =~ s/^\s+//; $link =~ s/\s+$//; } return $link; } } sub summary { my $item = shift->{entry}; if (@_) { $item->{description} = ref($_[0]) eq 'XML::Feed::Content' ? $_[0]->body : $_[0]; ## Because of the logic below, we need to add some dummy content, ## so that we'll properly recognize the description we enter as ## the summary. if (!$item->{content}{encoded} && !$item->{'http://www.w3.org/1999/xhtml'}{body}) { $item->{content}{encoded} = ' '; } } else { ## Some RSS feeds use for a summary, and some use it ## for the full content. Pretty gross. We don't want to return the ## full content if the caller expects a summary, so the heuristic is: ## if the contains both a and one of the elements ## typically used for the full content, use as summary. my $txt; if ($item->{description} && ($item->{content}{encoded} || $item->{'http://www.w3.org/1999/xhtml'}{body})) { $txt = $item->{description}; ## Blogspot's 'short' RSS feeds do this in the Atom namespace ## for no obviously good reason. } elsif ($item->{'http://www.w3.org/2005/Atom'}{summary}) { $txt = $item->{'http://www.w3.org/2005/Atom'}{summary}; } XML::Feed::Content->wrap({ type => 'text/plain', body => $txt }); } } sub content { my $item = shift->{entry}; if (@_) { my $c; if (ref($_[0]) eq 'XML::Feed::Content') { if (defined $_[0]->base) { $c = { 'content' => $_[0]->body, 'xml:base' => $_[0]->base }; } else { $c = $_[0]->body; } } else { $c = $_[0]; } $item->{content}{encoded} = $c; } else { my $base; my $body = (ref $item->{content}? $item->{content}{encoded} : $item->{content}) || $item->{'http://www.w3.org/1999/xhtml'}{body} || $item->{description}; if ('HASH' eq ref($body)) { $base = $body->{'xml:base'}; $body = $body->{content}; } XML::Feed::Content->wrap({ type => 'text/html', body => $body, base => $base }); } } sub category { my $entry = shift; my $item = $entry->{entry}; if (@_) { my @tmp = ($entry->category, @_); $item->{category} = [@tmp]; $item->{dc}{subject} = [@tmp]; } else { my $r = $item->{category} || $item->{dc}{subject}; my @r = ref($r) eq 'ARRAY' ? @$r : defined $r? ($r) : (); return wantarray? @r : $r[0]; } } sub author { my $item = shift->{entry}; if (@_) { $item->{author} = $item->{dc}{creator} = $_[0]; } else { $item->{author} || $item->{dc}{creator}; } } ## XML::RSS doesn't give us access to the rdf:about for the , ## so we have to fall back to the element in RSS 1.0 feeds. sub id { my $item = shift->{entry}; if (@_) { $item->{guid} = $_[0]; } else { $item->{guid} || $item->{link}; } } sub issued { my $item = shift->{entry}; if (@_) { $item->{dc}{date} = DateTime::Format::W3CDTF->format_datetime($_[0]); $item->{pubDate} = DateTime::Format::Mail->format_datetime($_[0]); } else { ## Either of these could die if the format is invalid. my $date; eval { if (my $ts = $item->{pubDate}) { my $parser = DateTime::Format::Mail->new; $parser->loose; $ts =~ s/^\s+//; $ts =~ s/\s+$//; $date = $parser->parse_datetime($ts); } elsif ($ts = $item->{dc}{date} or $ts = $item->{dcterms}{date}) { $ts =~ s/^\s+//; $ts =~ s/\s+$//; $date = DateTime::Format::W3CDTF->parse_datetime($ts); } }; return $date; } } sub modified { my $item = shift->{entry}; if (@_) { $item->{dcterms}{modified} = DateTime::Format::W3CDTF->format_datetime($_[0]); } else { if (my $ts = $item->{dcterms}{modified} || $item->{'http://www.w3.org/2005/Atom'}{updated}) { $ts =~ s/^\s+//; $ts =~ s/\s+$//; return eval { DateTime::Format::W3CDTF->parse_datetime($ts) } || eval { XML::Atom::Util::iso2dt($ts) }; } } } sub lat { my $item = shift->{entry}; if (@_) { $item->{geo}{lat} = $_[0]; } else { return $item->{geo}{lat}; } } sub long { my $item = shift->{entry}; if (@_) { $item->{geo}{long} = $_[0]; } else { return $item->{geo}{long}; } } sub enclosure { my $entry = shift; if (@_) { my $enclosure = shift; my $val = { url => $enclosure->{url}, type => $enclosure->{type}, length => $enclosure->{length} }; if ($XML::Feed::MULTIPLE_ENCLOSURES) { push @{$entry->{entry}->{enclosure}}, $val; } else { $entry->{entry}->{enclosure} = $val; } } else { my $tmp = $entry->{entry}->{enclosure}; if (defined $tmp) { my @encs = map { XML::Feed::Enclosure->new($_) } (ref $tmp eq 'ARRAY')? @$tmp : ($tmp); return ($XML::Feed::MULTIPLE_ENCLOSURES)? @encs : $encs[-1]; } return; } } 1; libxml-feed-perl-0.53+dfsg.orig/Makefile.PL0000444000175000017500000000174712633540754017733 0ustar gregoagregoa# Note: this file was auto-generated by Module::Build::Compat version 0.4214 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'XML::Feed', 'VERSION_FROM' => 'lib/XML/Feed.pm', 'PREREQ_PM' => { 'Class::ErrorHandler' => 0, 'DateTime' => 0, 'DateTime::Format::Mail' => 0, 'DateTime::Format::W3CDTF' => 0, 'Feed::Find' => 0, 'HTML::Entities' => 0, 'HTML::TokeParser' => 0, 'LWP::UserAgent' => 0, 'List::Util' => 0, 'Module::Pluggable' => 0, 'Scalar::Util' => 0, 'Test::More' => 0, 'URI' => 0, 'URI::Fetch' => 0, 'XML::Atom' => '0.38', 'XML::LibXML' => '1.66', 'XML::RSS' => '1.47' }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [], 'PL_FILES' => {} ) ; libxml-feed-perl-0.53+dfsg.orig/META.yml0000444000175000017500000000355712633540754017233 0ustar gregoagregoa--- abstract: 'XML Syndication Feed Support' author: - 'Six Apart' build_requires: URI: '0' configure_requires: Module::Build: '0.42' dynamic_config: 1 generated_by: 'Module::Build version 0.4214, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: XML-Feed provides: XML::Feed: file: lib/XML/Feed.pm version: '0.53' XML::Feed::Content: file: lib/XML/Feed/Content.pm version: '0.53' XML::Feed::Enclosure: file: lib/XML/Feed/Enclosure.pm version: '0.53' XML::Feed::Entry: file: lib/XML/Feed/Entry.pm version: '0.53' XML::Feed::Entry::Format::Atom: file: lib/XML/Feed/Entry/Format/Atom.pm version: '0.53' XML::Feed::Entry::Format::RSS: file: lib/XML/Feed/Entry/Format/RSS.pm version: '0.53' XML::Feed::Format::Atom: file: lib/XML/Feed/Format/Atom.pm version: '0.53' XML::Feed::Format::RSS: file: lib/XML/Feed/Format/RSS.pm version: '0.53' requires: Class::ErrorHandler: '0' DateTime: '0' DateTime::Format::Mail: '0' DateTime::Format::W3CDTF: '0' Feed::Find: '0' HTML::Entities: '0' HTML::TokeParser: '0' LWP::UserAgent: '0' List::Util: '0' Module::Pluggable: '0' Scalar::Util: '0' Test::More: '0' URI::Fetch: '0' XML::Atom: '0.38' XML::LibXML: '1.66' XML::RSS: '1.47' resources: license: http://dev.perl.org/licenses/ repository: https://github.com/davorg/xml-feed version: '0.53' x_contributors: - 'Dave Cross ' - 'Jakob Voss ' - 'Tatsuhiko Miyagawa ' - 'Simon Wistow ' - 'Gabor Szabo ' - 'Minty Walker ' - 'Karen Etheridge ' - 'Gerard Ribugent Navarro ' x_serialization_backend: 'CPAN::Meta::YAML version 0.016' libxml-feed-perl-0.53+dfsg.orig/META.json0000444000175000017500000000542312633540754017375 0ustar gregoagregoa{ "abstract" : "XML Syndication Feed Support", "author" : [ "Six Apart" ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4214", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "XML-Feed", "prereqs" : { "build" : { "requires" : { "URI" : "0" } }, "configure" : { "requires" : { "Module::Build" : "0.42" } }, "runtime" : { "requires" : { "Class::ErrorHandler" : "0", "DateTime" : "0", "DateTime::Format::Mail" : "0", "DateTime::Format::W3CDTF" : "0", "Feed::Find" : "0", "HTML::Entities" : "0", "HTML::TokeParser" : "0", "LWP::UserAgent" : "0", "List::Util" : "0", "Module::Pluggable" : "0", "Scalar::Util" : "0", "Test::More" : "0", "URI::Fetch" : "0", "XML::Atom" : "0.38", "XML::LibXML" : "1.66", "XML::RSS" : "1.47" } } }, "provides" : { "XML::Feed" : { "file" : "lib/XML/Feed.pm", "version" : "0.53" }, "XML::Feed::Content" : { "file" : "lib/XML/Feed/Content.pm", "version" : "0.53" }, "XML::Feed::Enclosure" : { "file" : "lib/XML/Feed/Enclosure.pm", "version" : "0.53" }, "XML::Feed::Entry" : { "file" : "lib/XML/Feed/Entry.pm", "version" : "0.53" }, "XML::Feed::Entry::Format::Atom" : { "file" : "lib/XML/Feed/Entry/Format/Atom.pm", "version" : "0.53" }, "XML::Feed::Entry::Format::RSS" : { "file" : "lib/XML/Feed/Entry/Format/RSS.pm", "version" : "0.53" }, "XML::Feed::Format::Atom" : { "file" : "lib/XML/Feed/Format/Atom.pm", "version" : "0.53" }, "XML::Feed::Format::RSS" : { "file" : "lib/XML/Feed/Format/RSS.pm", "version" : "0.53" } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "https://github.com/davorg/xml-feed" } }, "version" : "0.53", "x_contributors" : [ "Dave Cross ", "Jakob Voss ", "Tatsuhiko Miyagawa ", "Simon Wistow ", "Gabor Szabo ", "Minty Walker ", "Karen Etheridge ", "Gerard Ribugent Navarro " ], "x_serialization_backend" : "JSON::PP version 2.27300" }