Thursday, July 17, 2008

Feed2JS: Convert RSS to JavaScript

Shame on me: here I've had this blog for weeks now, and I haven't posted anything yet about, the "Feed 2 JavaScript" service that I use all the time. So, let me take care of that right now! (In a later post, I'll explain how to use Feedburner to accomplish something similar, converting RSS to a javascript you can use in a blog, wiki or website - very handy if you are laready using Feedburner to manage your feeds.)

Feed2JS is a web-based utility which will take an RSS feed (from a blog, from a wiki, an RSS feed of your tags), and turn that feed into a javascript so that you can insert it into a webpage environment. You cannot display RSS directly in a webpage environment because RSS is pretty scary-looking computer gobbledy-gook, but the Feed2JS services takes the gobbledy-gook (also known as XML) and turns it into something humans can read (in other words, HTML).

You can configure just what part of the RSS feed you want displayed - the name of the source (or not), the dates of the posts (or not), the number of posts, and so on. For serious web folks, you can also play around with CSS in order to create a particular style for the way the content will be displayed. The only caveat is that the javascript sits on the server; if it goes down for maintenance or some other reason, your script will come up blank. So, you might want to talk to the IT guys in your school or company about running your own copy of Feed2JS locally; you can get information about how to do that at the website.

Meanwhile, here's how you can use the standard Feed2JS service in just a few easy steps:

Step 1: Generate Preview. Get the RSS feed address you want to use, and go to the Build page at the website. Paste in the URL of the feed, and choose any of the options shown there. Then click on the Preview Feed button to make sure the results are what you wanted.

Just as a sample, here are the latest three items from the feed for our student newspaper at OU, the OU Daily:

Step 2: Get Code. If the results look good to you, click on the Close Window button. Then, click on the Generate Javascript button, and get the code from the box on the screen. You need to highlight all the code that is in the box, and copy it:

Step 3: Insert Code. You are now ready to insert the javascript code into a web environment that allows javascript (I've posted previously in this blog about how to insert javascripts into blogs, Desire2Learn, and PBWiki, among others).

So - presto! - here are the latest headlines from our student newspaper:

Some dynamic content may not display if you are reading this blog via RSS or through an email subscription. You can always visit the How-To Tech Tips blog to see the full content, and to find out how to subscribe to the latest posts.