Reputation: 665
I want to detect if my XML RSS feed has been updated and push those new updated items into my displayed rss feed using jquery. What's an effective way of accomplishing this?
Upvotes: 0
Views: 133
Reputation: 33012
Knowing if a feed has been updated is tricky. The PubSubHubbub protocols allows you to be pinged when a feed has been updated. The ping is fat which means that it contains the new content. Unfortunately, depending on the type of feeds you're looking at, the protocol can be widely implemented, or not so much. For example, if you're looking at blogs, you'll have a huge benefit as most popular blogging platforms implement it (Blogger, Wordpress, Medium... etc). For the feeds who do not support the protocol, you'll have to resort to conditional polling using Etags and If-Modified-Since so that the server may tell you if the feed has not been updated. Unfortunately, the coverage isn't much better here, and you have to poll the whole feed and then extract the new ones (by diffing against caches on your end).
That being said the most effective of doing it is to not do it and rely on a service like Superfeedr to do it on your behalf!
Upvotes: 1