New Workflow: Download a Tumblr Image
Here is a Workflow for downloading an image from a Tumblr post. I have not tested it on photosets. Install the workflow; then copy a Tumblr permalink to your clipboard and run the workflow. It will download the highest resolution image to your Camera Roll.
I am using the Tumblr photo posts API for this workflow. In my testing, an API key is not required to get information about this type of post, but I have included an action within the workflow for a key, which you can get if you register an application.
Essentially, if I take a permalink from a Tumblr, I can extract the host name (www.kungfugrippe.com) and post ID (127161182254) and get a JSON response at https://api.tumblr.com/v2/blog/www.kungfugrippe.com/posts?id=127161182254&api_key=. Then I can move down the "tree" until I get the url for the original_size image.
The Workflow, Step-by-Step, Explained
- Get Clipboard: Gets the URL of the permalink from the clipboard. (I run this workflow from the Today widget.)
- Get Component of URL: Get the host component of the URL (e.g., www.kungfugrippe.com)
- Set Variable: Call it host.
- Get Clipboard: Get the URL again.
- Get Component of URL: Get the path of the URL (e.g., /post/127161182254/katewillaert-rip-yvonne-craig-1937-2015)
- Set Variable: Call it path.
- Get Variable: Set path as input.
- Split Text: Separate at /.
- Get Item from List: The post ID would be the 3rd item in the index of this split array.
- Set Variable: Set the post ID as id.
- Text: This is left blank, but you could put your Tumblr OAuth Consumer Key here.
- Set Variable: Set it as key.
- Text: The API call, which is https://api.tumblr.com/v2/blog/host/posts?id=id&api_key=key.
- Get Contents of URL: Get the contents of the URL above.
- Get Dictionary from Input: This sets up a dictionary of the key:value pairs of the JSON results pulled from the URL.
- Get Value for Key: Here I'm just parsing my way down the JSON tree. First is response.
- Get Value for Key: Then posts.
- Get Value for Key: photos
- Get Value for Key: original_size
- Get Value for Key: url
- Get Contents of URL: Retrieve the image from the above URL.
- Save to Photo Album: Action complete.