#!/usr/bin/perl
# Time-stamp: "2008-05-31 22:20:30 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.maakies.com/",
 "Maakies",
 "Tony Millionaire's Maakies, Drinky Crow, Uncle Gabby",
);
rss_daily();
rss_self_url(      "http://interglacial.com/rss/maakies.rss" );
rss_generator_url( "http://interglacial.com/rss/maakies.pl" );
rss_livejournal( 'maakies' );


get_url(my $inurl = 'http://www.maakies.com/frames/list.html');

rss_item_limit(5);

s{<A }{\n<A }g; # for code-readabily's sake

my @them;
while(
 m{<A HREF="(/archive/m\d+\.html)" target="main">(#m\d+[^\n\r]*?)</?a>}mg
) {
  my($u, $t) = ( "http://www.maakies.com$1", $2 );
  DEBUG and print "$u $t\n";
  push @them, [$u,$t];
}

rss_item( $_->[0], $_->[1] ) foreach reverse @them;

rss_item_count or die "$0: Nothing found in $inurl\n{{\n$_\n}}\nAborting";
rss_save("maakies.rss", 14);

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


__END__
