jfhovinne

jFeed: JavaScript jQuery RSS/ATOM feed parser plugin

2007-07-15

I needed a lightweight JavaScript feed parser based on jQuery and couldn't find one, so I wrote jFeed yesterday. Thanks to jQuery, it was quite easy and fun to do.

jFeed currently parses RSS 0.91, 0.92, 1.0, 2.0 and Atom 1.0 feeds.

Usage:


jQuery.getFeed(options);

   options:

   * url: the feed URL (required).
   * data: data to be sent to the server. See jQuery.ajax data property.
   * success: a function to be called if the request succeeds.
     The function gets passed one argument: the JFeed object.
   * error: a function to be called if the request doesn't succeed.

   returns:

   * the XMLHttpRequest object returned by the $.ajax() function.

   Example:

   jQuery.getFeed({
       url: 'rss.xml',
       success: function(feed) {
           alert(feed.title);
       }
   });

JFeed properties:


   * feed.type
   * feed.version
   * feed.title
   * feed.link
   * feed.description
   * feed.language
   * feed.updated
   * feed.items: an array of JFeedItem

JFeedItem properties:


   * item.title
   * item.link
   * item.description
   * item.updated
   * item.id

jFeed is dual licensed under MIT/GPL.

Download jFeed

UPDATE: Latest jFeed builds are available on the GitHub page.

Examples are provided in the archive, as well as a basic PHP proxy (testing purposes only) for loading external feeds.

Note: the feed must be sent as XML, thus the content-type needs to be specified as text/xml or application/xml.

Updates

The jFeed repository is now hosted on GitHub, and downloads of the latest source code are also available.

If you want to improve jFeed and share your code, please fork the jFeed GitHub repository and propose your patch by sending a pull request.

Happy hacking and thanks in advance for sharing.