RSS import using AJAX and .NET


Below you can download a bare-bones code example that will import an RSS feed using an asynchronous Javascript (AJAX) call. Restrictions in browser security prohibit asynchronous calls to a different domain, so it uses a server-side .NET RSS hub that grabs it from another server. This hub also does the parsing to XHTML, using an XSL style sheet.

This way of importing news can be very handy if you would like to connect older websites to news repositories without having to poke around in ancient code. You can just drop the Javascript call into any content management system's HTML editor. This will cause the list to appear inside your web page. From then on, it will be automatically refreshed. Be careful though: in some crappy WYSIWYG's the Javascript will also be executed in edit mode, causing the list to be saved "hard-coded".

This zip file contains the .NET hub, the AJAX code and an example. To make it work, unzip all the files in "http://yourroot/somedir". Use "view source" on the example page to see the actual Javascript call. You will have to adjust the variable "root", so that it points to your hub location, and the location of the rss.js file that will do the actual importing. Of course you can choose any url for variable "rssurl", which points to the RSS feed you would like to see.


You are trying to view the newsticker in a browser that doesn't support it. I am sorry.