Monday, March 19, 2007

Wikipedia watchlist as webfeed

UPDATE: The scripts mentioned in this post were not working for a while due to changes in the MediaWiki API (which is in alpha). They are now working again.

Wikipedia's watchlist feature just calls out for a RSS feed. Why should you have to keep checking your watchlist page, rather than being notified when an edit to a watched article actually occurs? Though the web interface to Wikipedia does not offer such a feed right now, all is not lost—Wikipedia has a not too well-publicized XML API which, among other things, allows you to log in and fetch your watchlist as a RSS/ATOM feed.

Here are two scripts that take advantage of this API: if you have Python installed and run an aggregator program like Liferea which lets you specify a local script as a feed source, then you can use this Python script by Jyotirmoy Bhattacharya; otherwise you can use Tim Morgan's CGI script, a copy of which he has kindly hosted on his own server (but be sure to read the caveats on his blog first).

3 comments:

Tim Morgan said...

My script seems to be working again. Do you have reason to believe it doesn't work right now?

Anonymous Economist said...

Tim: Thanks. The scripts had stopped working and I hadn't checked back. You're right, they are working again and I have updated my post. Looking at the API, they seem to have added an extra parameter for the reporting period with a default value of 24 hours.

Alex Dodge said...

Without knowing about these scripts, I wrote a perl script that generates an RSS feed from a user's watchlist. I don't know how it compares to these, but I use it and it works for me.