Skip to content

Instantly share code, notes, and snippets.

@mislav
Last active December 13, 2015 19:18
Show Gist options
  • Save mislav/4961392 to your computer and use it in GitHub Desktop.
Save mislav/4961392 to your computer and use it in GitHub Desktop.
Update script for your Twitter archive
  1. Get your Twitter archive;
  2. Save this script as an executable in the root folder of your tweets archive;
  3. Execute the script from anywhere (e.g. a cron job).

It auto-installs grailbird_updater in an isolated location. Thanks, @DeMarko!

#!/usr/bin/env bash
set -e
here="$(cd "${0%/*}" && pwd)"
export GEM_HOME="$here/.gem"
export GEM_PATH="$GEM_HOME"
export PATH="$GEM_HOME/bin:$PATH"
if ! [ -d "$GEM_HOME" ]; then
ruby_version="$(ruby -e 'puts RUBY_VERSION')"
if [ "$ruby_version" \< "1.9" ]; then
echo "grailbird_updater needs Ruby 1.9 to run (was $ruby_version)" >&2
exit 1
fi
gem install --no-rdoc --no-ri grailbird_updater
fi
exec grailbird_updater --verbose "$here"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment