Search code examples
javascriptphptumblr

Script that will grab random images from various tags on tumblr


I want to have a webpage that grabs random images from specified tags on tumblr. I know that there's a script on stackoverflow that does that with one blog, but I need something that will grab images from tags. Is it even possible to create?


Solution

  • Have a look here https://www.tumblr.com/docs/en/api/v2#tagged-method You can use for example:

    http://api.tumblr.com/v2/tagged?tag=lol&api_key=blablab
    

    to get a json of some pictures, then shuffle the array with sonething like this

    How to randomize (shuffle) a JavaScript array?