Blog Pile

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.

Profile Picture for Alan Levine aka CogDog
An early 90s builder of the web and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person.

Comments

  1. 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 http://www.vialin.com

    http://www.moreover.com/cgi-local/page?o=rss&c=Arts%20and%20culture%20news

    You article is one of the most useful around.

    Sergio

  2. 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

  3. Hi,

    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?

    Thanks

Comments are closed.