#!/usr/bin/perl
# the simplest possible way to make an rss feed
# perl script to take an html ordered list and convert it to rss xml
# all regex all the time

use strict;
use XML::RSS::SimpleGen;
my $url = q<http://superkuh.com/blog/recent14.html>;
#my $url = q<http://127.0.0.1/blog/recent56.html>;
my $baseurl = q<http://www.superkuh.com/>;
my $clickthroughurl = "http://superkuh.com/blog/blog.html";

print "starting...";

rss_new( $url, "superkuh's blog", "recently *modified* posts" );
rss_language( 'en' );
rss_webmaster( 'rss@superkuh.com' );
rss_daily();

get_url( $url );

while(
 m{<li><a href="/(.*?)">(.*?)</a>(.*?)</li>}sg
) {
rss_item("$baseurl$1", $2, $3);
}

die "No items in this content?! {{\n$_\n}}\nAborting"
 unless rss_item_count();

rss_save( '/home/superkuh/www/blog/rss.xml', 45 );
print "$url done.\n";
exit;

#while(
# m{<h4>\s*<a href='/(.*?)'.*?>(.*?)</a>\s*</h4>\s*<p.*?>(.*?)<a href='/}sg
#) {
#rss_item("$url$1", $2, $3);
#}

