Return to Snippet

Revision: 11851
at February 22, 2009 14:30 by chrisaiv


Initial Code
<script type="text/javascript" src="./js/jquery/jquery.js"></script>
<script type="text/javascript" src="./js/jFeed/build/dist/jquery.jfeed.pack.js"></script>
<script type="text/javascript">
function loadFeed(){
	$.getFeed({
		url: 'proxy.php?url=http://locationofrssfeed/',
		success: function(feed) {

			//Title
			$('#result').append('<h2><a href="' + feed.link + '">' + feed.title + '</a>' + '</h2>');

			//Unordered List
			var html = '<ul>';

			$(feed.items).each(function(){
				var $item = $(this);
				//trace( $item.attr("link") );
				html += '<li>' +
				'<h3><a href ="' + $item.attr("link") + '" target="_new">' + $item.attr("title") + '</a></h3> ' +
				'<p>' + $item.attr("description") + '</p>' +
				// '<p>' + $item.attr("c:date") + '</p>' +
				'</li>';
			});

			html += '</ul>';

			$('#result').append(html);
		}
	});
}
<script type="text/javascript">

Initial URL


Initial Description
Here's a simple example of how to parse RSS feeds using jQuery.  You will need jFeed (http://www.hovinne.com/blog/index.php/2007/07/15/132-jfeed-jquery-rss-atom-feed-parser-plugin) and a bit of help from PHP (http://snipplr.com/view/12467/php-capture-rss-feed/)

Initial Title
jQuery: Parse RSS Feed

Initial Tags
jquery

Initial Language
jQuery