Jump to content
HOrdover

Possible? take all imgs from google drive folder-->upload to wordpress media library

Recommended Posts

Hoping this is the right place to post. I've been searching everywhere (this site and the web) and while I'm sure someone has made a version of the workflow I need I'm just as certain I'm using the wrong search string.

 

Why it's needed:

I'm finding that the thing that's taking the most time in my weekly workflow is collecting images and screenshots, uploading them to my wordpress site, gathering the URLs for all the images, then pasting the URLs into the weekly shownotes for my podcast—shownotes that I have to upload to the podcast media host which then places them to all the destinations (including my wordpress site).

 

I work in Markdown for speed and have managed to find a way to auto-code all of the links and notes I collect during the week from Google Sheets into my Shownotes Markdown Template, so that takes about 30 seconds to generate every Friday (down from it taking hours - so that's great).

 

Gathering URLs for any and all images for the shownotes, though, takes For. Ever.

 

 

What is needed: 

A workflow that would—

  • go to a specific Google Drive* or Dropbox folder 
  • download (or otherwise "get") all the images in that folder
  • put/move/upload/place those images into a specific wordpress.org/self-hosted WP site's media library
  • provide me the URLs to those newly uploaded images

 

I rather expected I'd be able to find, if not one complete workflow, at least a couple or several I could cobble together—but no luck, and my workflow building skills aren't up to speed yet.

 

I'd managed to get a python script to work on my iPhone/Editorial app once — but not pulling from Google Drive and not with multiple images.

 

Any ideas/guidance/links/tutorials = much appreciated!

 

*(an assistant uses GD right now, but could use either)

Share this post


Link to post
Your best bet for grabbing the images is to take them from the Dropbox/Google Drive folder on your hard disk, not via API. The APIs are fairly complicated to use. You have to mess about registering applications and retrieving API keys.

 

How you upload the images depends on how you access the server.

 

If you have a self-hosted website, then presumably you also have ssh access to the server. If you've set up key-based authentication, you can upload files to the server trivially with scp dir/of/images/* www.example.com:/path/to/my/wp/images/folder

 

Or push the images with git. Or sync the directories with rsync. There are many possibilities.

 

I would probably set up Hazel to automatically upload any images I put in the Upload folder. Or you could attach a Folder Action. Or indeed use Alfred to start the script.

 

Generating the URLs for the images is also trivial. You know the filenames, and you know the URL of the directory you've uploaded them to.

 

I can't say anything more concrete without a more concrete description of the task.

Share this post


Link to post

See, I knew I wasn't using the right search terms.

And just your mention of "Hazel" was enough, I think, to configure a reasonably fast solution.

 

 

I used to FTP files to sites all the time but I'm still pretty much in 2010 when it comes to code/protocols - I had kids. (I hope that's 'nuff said.) I'm scrambling to catch up to you et al in what time I can carve out.

 

Your answer, however, has definitely put me on the right track. Thank you so much!

Share this post


Link to post

Look into setting up ssh access on your server, especially key-based, passwordless access.

 

Once that's working, almost everything else, from GUI apps like Transmit to rsync and git, will be able to transparently connect to your server because they piggy-back over ssh (e.g. SFTP in Transmit etc.).

 

It's also easier to work with (for scripting) than FTP.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...