RSS Updates

RSS Updates

by Pauline Randall -
Number of replies: 4
I have added RSS feeds from the BBC onto our test server and everything looks like it works fine however I have just realised today that it is only pulling over the feeds from a week ago, when I set them up. I have taken all the feeds out and deleted the blocks and started again but it is still giving me stories a week old! I have recopied the RSS link to make sure that is OK but still no joy! Any suggestions??!
Average of ratings: -
In reply to Pauline Randall

Re: RSS Updates

by Matthew Bockol -
Hi Pauline,

I'm seeing this same sort of behavior on a BBC feed ( http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml ).  If I remove the cache'd copy ( moodledata/cache/rsscache/{md5hash of url I think} ) then it polls the site again and will get fresh material, but I don't know how often that happens. I looked at the headers the BBC site is sending but don't see anything odd. Did you find a solution?

Thanks,
Matt Bockol
In reply to Matthew Bockol

Re: RSS Updates

by Steve Garcia -
I've never had the RSS feeds work without "help."

I added the following to my cron table, and this solved the problem.  It counts as a "dirty hack" but it works. 

*/30 * * * * rm /var/www/moodledata/cache/rsscache/*

This deletes the RSS cache once every half hour, which forces the system to retrieve from the original sources that often.  This was necessary on our old Solaris machine running Moodle 1.5.3, and it is necessary on the newer Linux box running Moodle 1.6.2.  Alter the cron to match your actual path to the rsscache directory.

I also note that Ibiblio changed the format of their RSS feeds and the RSS module can no longer read those feeds.  It's RSS version 2.0, fwiw.
In reply to Steve Garcia

Re: RSS Updates

by Matthew Bockol -
Hi Steve,

Thanks for the tip. I tracked down my problem (finally!). It turns out that the Magpie rss and Snoopy libs that Moodle use to poll the web server hosting the RSS feeds have a bug (I think the bug is actually in Magpie, but it's debatable).
 
When my Moodle server requests an update from the BBC feed the Snoopy lib connects to newsrss.bbc.co.uk and sends the following:

GET /rss/newsonline_uk_edition/world/rss.xml HTTP/1.0
User-Agent: MagpieRSS/0.72 (+http://magpierss.sf.net)
Host: newsrss.bbc.co.uk:80
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
If-None-Match: "3a18-513ce080"

If-Last-Modified: Tue, 03 Oct 2006 14:55:46 GMT


Note the extra line between the If-None-Match and If-Last-Modified lines.

Normally this would work just fine. The BBC's server has no trouble parsing that request. However, our campus is behind a sidewinder firewall. It thinks the extra space is malicious in some way and drops the connection, hence no updates.  These header lines are only sent if a cache file exists, which is why your cron job fixes the problem.
 
I have a patch that removes the extra blank line, but I haven't submitted it because a) I'm not sure it's really a bug (more like a problem with our firewall) and b) it's not in Moodle code but a third party library.  I probably should track down whomever maintains the Magpie code and send it their way, but I haven't gotten to that yet.
 
Matt