CDB cat dog-egories:

May 13, 2004

Note: CogDogBlog has a new WordPress powered home at All entries from this version have been moved there, so as a guide dog service try finding this article in its new home by title search.

Prototype for New RSS to JavaScript Code

I ought to be something else, but have been bothered by two items regarding our often used RSS2JS (allows humans to use RSS by cut and past JavaScript, processed by a PHP middle ware script).

  1. It hinged upon the defunct, gone, and un-documented OnyxRSS Parser.
  2. It could not handle Atom feeds, and since Blogger is offering that now as the default, trouble loomed.
  3. The old site needs a revamp and better documentation.

So this morning I downloaded and began toying with the Magpie RSS parser and am pretty pleased with what I have been able to wrench out of it. Magpie offers the ability to cache feeds, plus its wider feed support look promising. It seems to parse the XML, and no matter what the tag is named (e.g. "dc:date" vs "pubdate" vs "modified") returns the data as a consistently named item one can deal with.

I've played around with a variety of RSS 0.91, 0.92, 1.0, 2.0, and Atom feeds and so far so good. Since some feed items have loooooooooong descriptions, I am adding an option where one could define that an item description be truncated at a certain number of characters.

Well enough babbling. I have a TEST version of the new build a feed page, which will disappear sometime soon once I have absorbed this into the main site or a more cohesive site. This new "build a feed" form provides only the feed preview, but the form stays consistent on the page so you can modify parameters for testing.

Comments welcome, unless I still have my blog comment forms still messed up (working on that too, yet another anti-spammer strategy).

The final version and downloads of this might be ready in a week or so. Gotta dream up a new design to hang the site.

blogged May 13, 2004 12:06 PM :: category [ rss ]
Comments About "Prototype for New RSS to JavaScript Code"
RSS Feed for comments on this entry
RSS Feed for all CDB comments

Alan: I broke my head with RSS feeds via Java as posted. Your side is nice documented, running the rss2js.php from your server is ok and looks as I want, but switching to my server do not display anything. I checked the code but I did not find the problem. Second problem was soon as inserted the java script on my page it jumps to the provider highest level (I want ART and CULTURE news, but on my page it shows Breaking News. HTML alone is OK just display the right parser...

I found you are re-writting the code again, I'm very interested in get it or just drop me an advice.

Only what I want is display the RSS
on my site

You article is one of the most useful around.

Commented by: Sergio Vargas on May 15, 2004 06:33 PM


I tried Alan's script to catch my Culture news at my site San Cristobal Antiques. Alan answered all my questions and I had my site live with a clean configurable solution.
Other solutions are not very friendly or lack of documentation. I adapted the script with Grab and Save script in other to catch the news on mysql database.
Hope it works for you, too.
Sergio Vargas

Commented by: Sergio on May 17, 2004 07:55 PM



sorry for sounding dumb , but im unable to find the rss2js.php script for download

can you point me to the link and if possible mail it to me?


Commented by: Satyajeet on May 20, 2004 11:44 PM


The current version is available at:

However, the newer version should be available maybe Wednesday next week.

Commented by: Alan Levine on May 21, 2004 12:58 AM

Spammers Have Force Our Hands...
Note: Those nasty blog-spamming roaches have forced us to take action to prevent their spread- all entries made to this blog will remain open for comments for 30 days after the original posting date. After that, it is old news anyhow, correct?

If you really need to make contact with the chief dog around here, please submit a request via our feedback center