#!/usr/bin/perl # # Get the Article of the Day from Wikipedia and make an RSS feed out of it. # # # Author: Cameron Mallory http://berserk.org # # You may use this code below as you see fit, in any form whatsoever. # $wget = "/usr/bin/wget"; use XML::RSS; my $rss = XML::RSS->new( version => '1.0' ); $rss->channel( title => "Wikipedia RSS by berserk.org", link => "http://en.wikipedia.org", description => "Today's featured article from wikipedia.org", master => "webmaster@berserk.org" ); ## ## Don't need to change anything below this ## $data = `$wget -q -O - http://en.wikipedia.com`; $data =~ s/\n/ /g; $data =~ s/a href="/a href="http:\/\/en.wikipedia.com/g; $match = ""; if ($data =~ /
Recently featured:/ ){ $match = $1; $rss->add_item( title => $rss->{channel}->{title} , link => $rss->{channel}->{link}, description => $match ); $rss->save("/full/path/to/your/directory/here/index.xml"); }