jFeed: JavaScript jQuery RSS/ATOM feed parser plugin
Par Jean-François, dimanche 15 juillet 2007 à 21:00 :: Dev :: #132 :: rss
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.
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
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, see Specifying the Data Type for AJAX Requests.
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.