I got a request from a teacher who wanted to download a years worth of images from a Glow Blog (for end of year slideshow).

Although there are plugins that can do this these are not available on Glow Blogs. I was stumped apart from going through the site and downloading them 1 by 1. But after a wee bit of thinking I though I’d try using the REST API via AppleScript.

The REST API will list in JSON format the media:

http://johnjohnston.info/blog/wp-json/wp/v2/media/

Look at that in FireFox for a pretty view.

JSON Helper is

an agent (or scriptable background application) which allows you to do useful things with JSON directly from AppleScript.

So I can grab the list of media from a site in JSON format use appleScript to download all the files.

The script I wrote is not great, you can’t download from a particular year, but a quick look at the JSON will help in working out how many files to download.

I am sure there are more efficient ways to do this and I’ve only tested on a couple of site, but it seems to do the trick and might be useful again sometime.

 

4 thoughts on “Downloading Media from WordPress using AppleScript

Mentions

  • Grant Potter

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)