Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BYO tumblr.
<script id="article-template" type="text/template">
<article>
<h1 class="title"></h1>
<time class="publishedDate"></time>
<div class="content"></div>
</article>
</script>
<div id="blog">Loading</div>
<script src="js/plates.js"></script>
<script src="http://www.google.com/jsapi"></script>
<script>
(function () {
var feedURL = "http://abbyseymour.tumblr.com/rss",
postsPerPage = 10,
blogContainer = document.getElementById( 'blog' ),
articleTemplate = document.getElementById( 'article-template' ).innerHTML,
init = function () {
var feed = new google.feeds.Feed( feedURL );
feed.setNumEntries( postsPerPage );
feed.load( insertPosts );
},
insertPosts = function ( response ) {
var entries = response.feed.entries,
fragment = Plates.bind( articleTemplate, entries );
blogContainer.innerHTML = fragment;
};
google.load( 'feeds', '1' );
google.setOnLoadCallback( init );
}())
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment