Skip to content
July 2, 2012 / Danii Oliver

Working RSS Reader

<body>
<script type=”text/javascript”>
$(document).ready(function(){
$.ajax({
type: “GET”,
url: “Movies.rss”,
dataType: “rss”, //or xml
success: function(xml) {
$(xml).find(‘item’).each(function(){
var title = $(this).find(‘title’).text();
var link = $(this).find(‘guid’).text();
var description = $(this).find(‘media\\:description’).text();
var writer = $(this).find(‘dc\\:creator’).text();
var date = $(this).find(‘pubDate’).text().substring(‘0′,’16’);
$(‘#feeds’).append(‘<div class=”items”><a href=”‘+link+'”><h2>’+title+'</h2></a><p class=”date”>’+date+'</p><p class=”writer”>’+writer+'</p><p class=”brief”>’+description+'</p></div>’);
});
}
});
});
</script>
<div id=”feeds”>
<div class=”items” id=”link_’+id+'”></div>
</div>

</body>

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: