A small script that scrapes a given Tumblr blog to JSON format.
These instructions assume that you have Ruby and Bundler installed and know a little about how to use them.
-
To use Tumblr API V2, you'll need to register an application at https://www.tumblr.com/oauth/apps.
-
Once you've done that, rename the
_envfile in this directory to.env. -
In
.env, change theCONSUMER_KEY=line to that app you just registered's "OAuth Consumer Key". Change theCONSUMER_SECRET=lines to your app's "secret key". (You can ignore theOAUTH_TOKENandOAUTH_TOKEN_SECRETlines.) -
By default, the script will save scraped blogs to:
{your home directory}/Downloads/Tumblr
You can change this in .env by uncommenting the OUTPUT_DIRECTORY= line and entering the directory you want.
- In the console, run the following command to install the dependencies:
bundle install- Finally, to scrape a blog, run the following command in the console:
bundle exec ruby scrape_blog.rb BLOG_NAME_GOES_HERE