(.*?)
\s*(.*?)#gis) {
my $story = {};
my ($link, $title, $body) = ($1, $2, $3);
$body =~ s#src="/#src="http://www.kottke.org/#gi;
$story->{link} = $link;
$story->{title} = HTML::Entities::encode_entities($title);
$story->{description} = HTML::Entities::encode_entities($body);
push(@stories, $story);
}
#############################################
# Output RSS file
#############################################
my $zero_dir = dirname $0;
open RSS, ">$zero_dir/kottke.rss" or die "Unable to write to kottke.rss: $!";
print RSS <<"EOF";
Newcum's Kottke Feed
http://www.kottke.org/index.html
David Newcum's RSS Feed of kottke.org. Contact rss_feeds\@paperlined.org for change requests.
en-us
EOF
foreach my $story (@stories)
{
print RSS <<"EOF";
-
$story->{title}
$story->{link}
$story->{description}
EOF
}
print RSS " \n";