-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="recentPosts"> | |
<p>Loading...</p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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