Sunday, March 02, 2014

Backing up my Pinterest data

I love Pinterest, but their organization is primitive. I couldn't clean up my board without making major changes and deleting pins. I didn't want to permanently delete them though, because I often go back to research I did years ago. So I made a local backup of my pins.

Here are the commands that worked for me using in a Bash shell on a Mac:

 # where do you want the backup to go?
cd /Users/manducasexta/Documents/Dropbox/computer/backup/pinterest

# what is your Pinterest URL?
a=http://www.pinterest.com/manducasexta/

# Exclude these pinterest directories; we only want our own boards.
excludeList=/popular,/all,/gifts,/terms,/copyright,/categories,/explore,/videos,/places,/_

# Download your home page and your boards
wget --convert-links --exclude-directories=$excludeList --recursive --level=2 --domains=pinimg.com,www.pinterest.com --span-hosts $a 
Watch out for line breaks. The lines that start with "#" are comments. Each comment is followed by text that should all be on one line, so you may need to fix the line if you copy and paste.

I wanted to minimize the effect on Pinterest servers, so I excluded directories and limited my recursion level to limit the download as much as possible to my own pins. The download does include things from other people's directories, but the only thing I saw downloaded from them was index pages (not images).

I have 709 pins. The local backup is 220 MB.


2 comments:

Anonymous said...

Nice script, but does wget come with MacOS? It doesn't seem to work by default for me on OS X 10.9.5.

Manduca said...

I used homebrewer to install wget