Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save askmeegs/8225867 to your computer and use it in GitHub Desktop.
Save askmeegs/8225867 to your computer and use it in GitHub Desktop.
function getPosts(){
query = "moonrise kingdom";
var tumblr = require('tumblr.js');
var client = tumblr.createClient({ consumer_key: '5AePbGS74iGUh2v1vIaLfxOeDAyS2X8sRPpnOPczwtFzGXEvz7' });
initialize data structure
client.tagged(query, function (err, data) {
//put 1000 image urls into a list
});
setInterval(function(){changeImage()},3000); //once posts are gotten, start changing background
}
function changeImage()
{
url = "https://24.media.tumblr.com/d2220b41e45b533c6aad4f2611467eb4/tumblr_myfi6a9AiQ1qjvnc4o1_500.jpg";
document.body.style.backgroundImage="url(" + url + ")";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment