Today, we’re happy to introduce the first Superfeedr Jquery plugin. It’s simple piece of syntactic sugar that was aked by one of our customers but makes it really simple to integrate an RSS feed into a page!
Its purpose is very simple: integrate a the content of any RSS or Atom feed in any page of your website, without the constraints of the same origin policy. It’s very useful in the context of javascript single page applications for example or in the context of full client side javascript applications without any server side code, like the kind of apps that runs on FirefoxOS or ChromeOS.
Example
The list of posts below is loaded using the following script (check the source! if you don’t trust me!).
$(document).ready(function() {
$.superfeedr.options.login = 'superfeedr';
$.superfeedr.options.key = '1a8c661804873703802212503e75d3c2';
var feed = new $.superfeedr.Feed('http://blog.superfeedr.com/atom.xml');
feed.load({count: 5}, function(result) {
if (!result.error) {
var container = $("#feed");
for (var i = 0; result.feed.items.length > i ; i++) {
var entry = result.feed.items[i];
$("#feed").append($('<li>' + entry.title + '</li>'))
}
}
});
});
The ticker on our home page uses the plugin if you’re looking for another example too!
Final notes
We believe this is an elegant replacement to the Google Feed API. Try it out and let us know what you think. It’s also on Github and you’re more than welcome to ask for more features, fork or submit pull requests. There is a also a small guide on how to get started quickly.
Comments