Skip to content

Instantly share code, notes, and snippets.

@skindy
Created September 20, 2013 23:03
Show Gist options
  • Save skindy/6645071 to your computer and use it in GitHub Desktop.
Save skindy/6645071 to your computer and use it in GitHub Desktop.
Retrieve and display a list of your most recent posts fro Tumblr using the Google Feed API
<div id="recentPosts">
<p>Loading...</p>
</div>
google.load("feeds", "1");
function OnLoad() {
// Create a feed control
var feedControl = new google.feeds.FeedControl(); //Create a feed control
// Add a RSS or XML feed. To add two feeds, simply copy the code below and change the URL
feedControl.addFeed("http://username.tumblr.com/rss");
// Set number of posts to display
feedControl.setNumEntries(6);
// Now display it in an element with an id of "recentPosts"
feedControl.draw(document.getElementById("recentPosts"));
}
google.setOnLoadCallback(OnLoad);
/* Tumblr Google Feed API
========================================================= */
/* Individual Post */
.gfc-result {border-bottom: 1px solid #c0c0c0; padding: 10px 0;}
/* Removes a border at the top of the very first post */
.gfc-resultsHeader {border: none !important;}
a.gf-title { font-size:.875em;}
/* Post date */
.gf-relativePublishedDate {font-size: .625em;}
/* Post snippet */
.gf-snippet {font-size:.875em;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment