Skip to content
Creates local txt backups of your 200wordsaday.com posts
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
200wad.rb
README.md

README.md

200wad backup script

This script creates a local backup of txt files, one for each of your entries on 200wordsaday.

  1. Create a file called api_key.rb with the following:
    API_KEY = '[your api key from 200wad]'
  2. Update root_dir to be the local directory you want your backup to live
  3. Install httparty: gem install httparty
  4. Run ruby 200wad.rb!

The script safely removes old backups. Edit next if item == '.' or item == '..' or item == '.DS_Store' appropriately, as it assumes a Mac filesystem, and that no other folders except generated backups exist in the root folder.

It also strips markup, converting paragraphs and blockquotes. For example:

<p>Lorem <a href="http://example.com">ipsum dolor</a> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>

<blockquote>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</blockquote>

<p>Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.</p>

will become:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.

Todo

  • Convert links into footnotes
  • Make deleting old backups a optional flag
  • Make deleting safer
You can’t perform that action at this time.