//************************ Load Tumblr Posts **************************** /* * @requires - ./Tumblr.js * @url - https://gist.github.com/HoundstoothSTL/ */ Tumblr.init({ dataType: 'json', apiKey: 'dSObejFjA8z2gAs4Nv0V9bwwj8oP6TRIF124kaXWFfPVwG6iuY', limit: '1', endpoint: 'http://api.tumblr.com/v2/blog/pixelpressgame.tumblr.com/posts/text', fragment: '?limit=' +this.limit+ '&api_key=' +this.apiKey, dataUrl: '/blog.json' }); var loadTemplates = function() { var post = Tumblr.posts[0], title = post.title, body = post.body, author = post.author, date = post.date url = post.url, twitter = post.twitter; // load up template elements here $('[data-template="title"]').text(title); $('[data-template="body"]').html(body); $('[data-template="author"]').text(author); $('[data-template="author"]').attr('href', twitter); $('[data-template="date"]').text(date); $('[data-template="url"]').attr('href', url); }; window.addEventListener('load', function() { loadTemplates(); });