RSS Reader

Something to display RSS feeds, but without using any server side scripting. Hmm, what to do here, and how to get around the cross-domain JavaScript restriction? The feeds to be displayed did not have a JSON-P option, so that was out. After some research, the workaround I came up with was to use Google’s Feed API to pull the data into the page. It worked quite well; the only issue I had was that the API couldn’t seem to pull beyond the first 4 entries, regardless of the value set in .setNumEntries().

I’d also recently been playing with creating my own ExtJS components, extending Ext.Panel and so forth, and this was a great opportunity to put what I’d learned into practice. It’d be loads easier to maintain if I could keep most of the code in one place and off of individual pages. In the end, the instantiation code was only 9 lines! Awesome! :)

var rssReader = new Alcedine.component.RSSReader({ applyTo: 'rss-reader', width: 750, feeds: [{ title: 'Alcedine', url: '', feed: '' }] });

One bug I discovered is that when including multiple feeds, whichever one loads faster will show up first in the list. Ideally, the feed order should mirror the order they are listed in the feeds array. It’s a fairly straightforward fix in my head; I’ll post an update when I have it working!

Live Demo | Gist