Skip to content

Instantly share code, notes, and snippets.

@nilskoppelmann
Created January 13, 2015 20:34
Show Gist options
  • Save nilskoppelmann/1ebbd44a9ee41dbc3d22 to your computer and use it in GitHub Desktop.
Save nilskoppelmann/1ebbd44a9ee41dbc3d22 to your computer and use it in GitHub Desktop.
"Tools" to download stuff from wordpress.com sites ... mainly to backup media

Please follow the instructions to backup "all" the media of one wordpress.com instance.

Go to https://your-blog.wordpress.com/wp-admin/upload.php

  • Click the first media item and then as the pop-up appears, right-click on the right-arrow/next-arrow (>) in the top-right-hand corner and select "Inspect Element".
  • Replace this button and the it contains with the corrosponding one you find in next-btn.html (this directory). This procedure my vary depending on the type of browser you use.
  • Go to your browsers Javascript console and initialize the path variable path by typing: path = "";
  • The pop-up still open: click through all the pictures/media-files until you reach the end. Never close the pop-up or you have to start all over again.
  • When you have reached the last picture, paste the following code into the Javascript console: var el=document.querySelector('div.settings label.setting:first-child input'); path += '\n' + el.value;
  • Then again in the Javascript console: clear all contents and then type: path
  • Copy the output of the JS console and paste it in a file in this directory called link-list
  • Make sure you remove the quotes (") at the front and end of the output
  • Run dl-media.sh and you should be good to go

=> all the files should appear in the sub-folder media of this directory (.)

If you have any questions feel free to contact me (@nilsology).

#! /bin/bash
mkdir ./media
wget -P ./media -i $1
<button class="right dashicons" onclick="var el=document.querySelector('div.settings label.setting:first-child input'); path += '\n' + el.value;"><span class="screen-reader-text">Edit next media item</span></button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment