As hinted, I have just posted an updated version of the RSS to JavaScript service/code we created in April 2003.

The new one is now called Feed2JS and features a number of enhancements- primarily an adoption of the open-source Magpie RSS parser, to replace the unsupported OnysRSS parser previously used. Magpie allows us to provide this support for Atom feeds. We have also added options to allow you to truncate the item descriptions by a specified number of characters as well as a new parameter to set links from the feeds to open in either a new browser window or the same window. Also, to make things simpler, we can generate the HTML version form the same script (for noscript tags, so we do not leave the JavaScript-less out in the cold).

For anyone using the older version, now archived at http://feed2js.org/rss2js2003.html, it will continue to run and the code will remain available from there.

Hopefully you will find the new site more usable, with my own new cheap graphic, as well as broken into subsections- examples of use of Feed2JS, basics of finding RSS feeds, the web tool to build your own feed using our server, a new section on styling your feeds with CSS, and the prized item, download and installation instructions.

You will have to get the Magpie RSS parser from its own source and set that up. It is not all that hard, and no more complicated then the older OnyxRSS parser.

Finally, since Google found hundreds of examples of other sites using our first version (RSS2JS), most that never contacted us, we ask that if you make use of our free service/code, to just share a URL we can post as an example.

Okay, it is out there. Now help me find the bugs!

The post "Here It Is! A New Feed2JS (and source code)" was originally cracked open and scrambled from a rotten egg at CogDogBlog (http://cogdogblog.com/2004/05/here-it/) on May 23, 2004.

13 Comments

  • David Carter-Tod itde.vccs.edu

    Alan,

    Line 154 in feed2js.php is missing the ; at the end

    define(‘MAGPIE_DIR’, ‘./cached/’)

    Also, in build.php I had to add all the _GET stuff, because register_globals is off on my server and any new php installation.

    David

  • David Carter-Tod itde.vccs.edu

    Alan,

    This page doesn’t appear to be quite working

    http://jade.mcli.dist.maricopa.edu/feed/index.php?s=examples

    David

  • joshua farber mediakit.blogspot.com

    A great service, Alan — thanks. (Found via the folks at MVCC, an example I’ve been using to show our own library folks what blogging+RSS can do for us).

    One tiny suggestion, though: a feed which doesn’t insist on starting so far to the right in a given area, especially when list settings are essentially null, would be much more useful, design-wise. How’s about a default setting which aligns the list at (or nearer to) the left margin, for those of us who don’t want our feed to align so far over?

    (for an example of this in action, see the “tinyblog” section on the right sidebar at http://mediakit.blogspot.com)

  • Alan Levine

    Joshua,

    There are not formatting specifications in our feeds that dictate the alignment or placement, it is all how you set up your own stylesheets- it can be left, right aligned, and fat or skinny, big font, little font, blue font, read font, bullets, no bullets…

    See:

    http://jade.mcli.dist.maricopa.edu/feed/index.php?s=style

  • joshua farber mediakit.blogspot.com

    Figured it out with some off-blog help from Alan — thanks Alan!

    But for posterity’s sake, did want to point out that what threw me was that this very nifty feed-producer automatically puts out its feed in list format (ul). Most of the previous tools I’ve used (like Feedroll, for example) don’t…and in our case, at least, it’s more work to integrate a list into one’s design than a simple series of text lines.

  • Alan Levine

    Glad you got it figured out.

    However I still think a UL list is the best *structural* entity for a feed. You are thinking of lists as they are normalled formatted, but you easily achieve the design you want by using

    .rss_items {

    list-style:none;

    }

    which removes bullets, and setting margins and paddings correctly gets you the “look”.

    A series of text lines does not convey anything about the meaning of the information- to a screen reader or someother type of display device, it just becomes run on text.

  • Ken

    define(‘MAGPIE_DIR’, ‘./cached/’);

    should be

    define(‘MAGPIE_CACHE_DIR’, ‘./cached/’);

  • Alan Levine

    Yikes, Ken, you are right. Some of the first releases had that the variable mis-defined.

    Trying to clean up these messes, thanks.

  • Education/Technology - Tim Lauer tim.lauer.name/archives/001433.html

    RSS to Javascript from Alan Levine

    cogdogblog Alan Levine has made available a very nice RSS to Javascript tool for the displaying of RSS feeds in web pages. I am currently using Feedroll to display the RSS from out Lewis Elementary calendar. I plan to move to Alan’s tool when I get som…

  • Education/Technology - Tim Lauer tim.lauer.name/archives/001433.html

    RSS to Javascript from Alan Levine

    cogdogblog Alan Levine has made available a very nice RSS to Javascript tool for the displaying of RSS feeds in web pages. I am currently using Feedroll to display the RSS from out Lewis Elementary calendar. I plan to move to Alan’s tool when I get som…

  • A way to include feeds in a static web site

    A few days ago, I found a site offering some software and a free service to convert RSS feeds into JavaScript, so they can be included with a simple <script> tag (the same “loophole” used by most dynamic advert systems, including Google-Ads). …

  • RSS to Javascript

    Mmmmmm…

  • Feed2JS

    Alan has reworked rss2js into Feed2JS. Basically, it now uses Magpie instead of OnyxRSS as it’s backend parsing tool. Extra feature is abaility to pasrse Atom feeds too. I’m downloading and will study and probably make the changeover on the variou…