Skip to content

Instantly share code, notes, and snippets.

@decklin
Last active March 1, 2017 01:14
Show Gist options
  • Save decklin/eb1281a4cae011580e9c0594e782ded9 to your computer and use it in GitHub Desktop.
Save decklin/eb1281a4cae011580e9c0594e782ded9 to your computer and use it in GitHub Desktop.
Using peach-backup

Using peach-backup

Hi, happy Peach-iversary, etc. I wrote this script to backup my Peach stream. To run it you have to open up Terminal and run commands; sorry! If you know me, I can help with that, otherwise find someone who can walk you through it. Everything here assumes you have a Mac. If you're on Linux, you can probably get it to work. Windows, unfortunately, I'm not sure.

Commands that you should copy from this page, one line at a time (in order!), and paste into your terminal, pressing Enter after each line, look like this:

echo "This is a command you can run! You did it!"

You can try that one now. It should reply with the part in quotation marks.

1. Installing Requirements

There are two ways to do this, the Homebrew way (takes a few minutes initially, leaves some additional programs installed), or the manual way. I recommend using Homebrew:

  • Go to http://brew.sh and follow the instruction at the top (it asks you to paste and run one command)

  • When that's done:

      brew install jq
      brew install node
      npm install -g pug-cli
    

The other way is to get the programs manually:

  • Go to https://nodejs.org, click on the recommended version, and run the installation package.

  • When that's done:

      curl -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
      chmod +x /usr/local/bin/jq
      sudo npm install -g pug-cli
    

2. Get the backup script and install it

The backup script lives in https://github.com/decklin/peach-curl. To get it from GitHub and install it:

git clone https://github.com/decklin/peach-curl.git
install peach-curl/peach /usr/local/bin

(this last command won't say anything, but it worked! Unless it gave an error.)

3. Back up your Peach

./peach-curl/contrib/peach-backup

This will take a while to run (leave the Terminal open!), and will write two main files:

  • peach-backup-data.json is all your Peach entries, as raw (for computers) data
  • peach-backup-index.html is an HTML file linking linking to one HTML file per month of posts

Plus one more HTML file for each month, and a directory peach-backup-images for your backed-up images and videos.

(Note: if you're impatient, the HTML is updated after each batch of entries and images are downloaded, so you can open another tab and go ahead to the next step while the script runs.)

To open the backup in your web browser, run:

open peach-backup-index.html

That's it! If you know me on Peach, I can answer questions there. I could use help improving the design of the HTML page, and adding comments (they're in the raw data, you just can't see them).

4. Appreciation

Uh, AGDQ is over, I got nothing. Maybe give to [https://www.translifeline.org](Trans Lifeline).

@decklin
Copy link
Author

decklin commented Jan 8, 2017

If you're using Chrome and GIFs aren't animating, it might be https://bugs.chromium.org/p/chromium/issues/detail?id=142096

@decklin
Copy link
Author

decklin commented Jan 9, 2017

Feel free to report other bugs in the comments.

@decklin
Copy link
Author

decklin commented Mar 1, 2017

For the purposes of splitting posts into monts, times are considered in UTC. This is documented behavior of jq, and there's a comment about it, but it looks bad, even though the times are eventually formatted in the local tz for display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment