title: Get a random image from tumblr
body: <p>How can I get and then display a random image from a post from a specific tumblr with javascript?</p>
  
  <p>I want it to be simple, something like when a button is pushed display a the random image.</p>
  
  <p>I'm just going to use foodgif.tumblr.com as an example.  So far I know you can get a random post just by including /random onto the end of the url.  (so <a href="http://foodgif.tumblr.com/random" rel="nofollow">http://foodgif.tumblr.com/random</a> will grab a random url that could be used to grab the image from)</p>
  
  <p>I also found <a href="https://github.com/iangreenleaf/node-tumblrbot" rel="nofollow">tumblrbot</a>, which is a Hubot-compatible Tumblr API wrapper for Node.js, and has code like the following:</p>
  
  <pre><code>tumblr = require('tumblrbot')
  
  tumblr.photo("foodgif.tumblr.com").random (post) -&gt;
            console.log post.photos[0].original_size.url
  </code></pre>
  
  <p>but all their code/examples seems to be in coffee script, and I'm already new to html/javascript/jquery.  Is there code usable in normal javascript?</p>
  
  <p>I could also just use the actual tumblr API, but other methods seems simpler and promising, so I'd rather that be a last resort.  Anyway I feel like I've got the means capable to do it, I just don't really know exactly how.  Any help?</p>