jFeed: jQuery feed parser plugin
Copyright (C) 2007-2011 Jean-François Hovinne - http://hovinne.com/
Dual licensed under the MIT (MIT-license.txt) and GPL (GPL-license.txt) licenses.
jQuery.getFeed(options);
Options:
url: the feed URL (required)data: data to be sent to the server. SeejQuery.ajaxdata propertysuccess: a function to be called if the request succeeds. The function gets passed one argument: theJFeedobject
jQuery.getFeed({
url: 'rss.xml',
success: function(feed) {
alert(feed.title);
}
});
feed.typefeed.versionfeed.titlefeed.linkfeed.descriptionfeed.languagefeed.updatedfeed.items:an array of JFeedItem
item.titleitem.linkitem.descriptionitem.updateditem.id
item.latlonitem.contentEncodeditem.imageURL
jQuery(this).find("georss\\:point,point"); -- this is, from the best I can tell, the best way of parsing the XML namespace, that works in both webkit browsers and Firefox. For more information, see this jquery post: http://bugs.jquery.com/ticket/10377
or this is discussed in this stackoverflow post: http://stackoverflow.com/questions/853740/jquery-xml-parsing-with-namespaces
-- Note -- imageURL: is parsed out of contentEncoded manually, since our feed has contentEncodeded enclosed within CDATA flags, which cause the HTML information to not be parsed by the JRss parser. This manual workaround occurs in the new JRss._getImageURLFromSrcTag(jQueryObject) function.
The _getImageURLFromSrcTag(jQueryObject) function takes a jQueryObject
that has a cdata-section childnode, which has a data attribute, where
the HTML that we want to use to pull our imageURL lives. We manually parse
that HTML into a jQuery object and then loop over the tags within it,
and pull the first valid src tag of the img we find. A src tag is valid if
it ends in .jpg, .JPG, .jpeg, .JPEG, .png, .PNG, .gif, .GIF.
Please see the provided examples for more information.
A basic PHP proxy is also available (proxy.php), if you need to load external
feeds (for testing purposes only, do not use it on public websites).