Showing posts with label simplepie. Show all posts
Showing posts with label simplepie. Show all posts

2008-11-14

FeedBurner vs. SimplePie

...ok, so for a while i was wondering why my website doesnt show my latest blog entries.
I am using SimplePie to fetch the latest RSS feed from FeedBurner and display the last five items. At the beginning i was suspicious of the cache mechanism, but even if i turn off caching completely, it will not fetch the latest feed. So i dugg myself into the internals of SimplePie and it turned out that when it fetches the feed from FeedBurner, it is presented a redirect to http://feedproxy.feedburner.com which indeed does NOT have the latest version. So the problem is not with SimplePie.
Interestingly this redirect doesnt show up when browsing or wgetting the feed.
As soon as i changed the user agent that SimplePie uses, the problem didnt show up any more.
Just add:
$feed->set_useragent('gecko');//anything but simplepie

Later doing some googling revealed this thread and a few others.