#!/usr/bin/perl
# Time-stamp: "2008-05-31 22:18:41 ADT"
# See http://www.interglacial.com/rss/ for info on RSS feeds

use strict;
use XML::RSS::SimpleGen 12;
use constant DEBUG => $ENV{'MAILTO'} ? 0 : 1;
  # to test whether we're under crontab

rss_new(
 "http://www.marlysmagazine.com/",
 "Marlys Magazine",
 "Featuring Ernie Pook's Comeek and more from Lynda Barry",
);
rss_daily();
rss_self_url(      "http://interglacial.com/rss/ernie_pooks_comeek.rss" );
rss_generator_url( "http://interglacial.com/rss/ernie_pooks_comeek.pl" );
rss_livejournal( 'ernie_pook' );

get_url(my $inurl = 'http://www.marlysmagazine.com/main.html');

rss_item_limit(5);

if( m{<img src=\'strips/comeek(\w+)\.gif\'} ) {
  DEBUG and print "Found comic $1\n";
  rss_item("$inurl#$1", "Ernie Pook's Comeek #$1");
} else {
  DEBUG and print "Odd, no item found\n";
}

rss_item_count or die "$0: Nothing found in $inurl\n{{\n$_\n}}\nAborting";

if(time() < 1175045311) {
  rss_item(
    'http://www.publishersweekly.com/article/CA6405731.html?nid=2789',
    'D&amp;Q Grabs New Lynda Barry Title',
    "Drawn &amp; Quarterly publisher Chris Oliveros will publish 'What It Is', acclaimed cartoonist Lynda Barry's first new book since 2002, in early 2008. D&Q will also republish her five-volume backlist of comic strip collections in newly redesigned editions."

  );

  rss_item(
    'http://www.marlysmagazine.com/12What-Is-A-Mood.jpg',
    "An image from Lynda's Work in Progress WHAT IT IS",
  );
}



rss_save(" ernie_pooks_comeek.rss", 14);

DEBUG > 1 and print "\n", rss_as_string, "\n";
DEBUG and print "\nEnd.\n";
exit;


__END__
