Skip to content

Instantly share code, notes, and snippets.

@ColeTownsend
Forked from alicial/recent-tumblr-posts.js
Created August 11, 2013 12:03
Show Gist options
  • Save ColeTownsend/6204599 to your computer and use it in GitHub Desktop.
Save ColeTownsend/6204599 to your computer and use it in GitHub Desktop.
$(function() {
var url = '/rss';
var $list = $('#recent-posts');
$.ajax({
url: url,
type: 'GET',
dataType: 'xml',
success: function(data) {
var $items = $(data).find('item');
$items.each( function() {
var $item = $(this);
var link = $item.children('link').text();
var title = $item.children('title').text();
if (link && title) {
$list.append($('<li><a href="' + link + '">' + title + '</a></li>'));
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment