Created
January 2, 2014 20:10
-
-
Save askmeegs/8225867 to your computer and use it in GitHub Desktop.
This file contains 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
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