[Netcomics-cvs] netcomics/lib oots_rss,NONE,1.1
Brought to you by:
elliotglaysher,
hochstrb
|
From: Sven H. <ha...@us...> - 2009-11-10 23:14:32
|
Update of /cvsroot/netcomics/netcomics/lib In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17316/lib Added Files: oots_rss Log Message: New oots_rss module from Clint Olson <clintcompute %&% olsonnetwork.com> which parses the RSS feed. Thank you very much! This module is able to download and display the comic only on days it is released. Drawback: it is _not_ able to download from earlier days than the current day (option -n <number>). This is a limitation of the OotS-RSS-feed, which only provides a lastBuildDate for the whole feed but no timestamps for the seperate items. --- NEW FILE: oots_rss --- #-*-Perl-*- #Add the name of the subroutines to the hash of functions #with the number of days from today the comic is available $hof{"oots_rss"} = 0; #Order of The Stick http://www.giantitp.com sub oots_rss { my $time = shift; my @ltime = gmtime($time); my @monthconv = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); my @dayconv = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); my $monthname = $monthconv[$ltime[4]]; my $dayname = $dayconv[$ltime[6]]; my $paddate = sprintf("%02d", $ltime[3]); my $datestring = $dayname . ", $paddate $monthname " . ($ltime[5] + 1900); my $rec = { 'title' => "Order of The Stick", 'author' => "Rich Burlew", 'type' => 'gif', 'main' => "http://www.giantitp.com", 'archives' => "http://www.giantitp.com/comics/oots.html", 'base' => "http://www.giantitp.com/", 'page' => "comics/oots.rss", 'referer' => "", 'exprs' => ['<lastBuildDate>' . $datestring . '[^<]*<\/lastBuildDate>.*?<link>http:\/\/www\.[Gg]iant[Ii][Tt][Pp]\.com\/([^<]*)', "(comics\/images\/[0-9a-zA-Z()_]+.[a-z][a-z][a-z])"], }; return $rec; } 1; |