Skip to content

Instantly share code, notes, and snippets.

@pauldruziak
Forked from mislav/readme.md
Last active December 13, 2015 20:48
Show Gist options
  • Save pauldruziak/4972309 to your computer and use it in GitHub Desktop.
Save pauldruziak/4972309 to your computer and use it in GitHub Desktop.
  1. Get your Twitter archive;
  2. Save this script as an executable in the root folder of your tweets archive (~/tweets);
  3. Save com.paveldruzyak.grailbird_updater.plist to ~/Library/LaunchAgents
  4. run from console launchctl load -w ~/Library/LaunchAgents/com.paveldruzyak.grailbird_updater.plist

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

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.paveldruzyak.grailbird_updater</string>
<key>ProgramArguments</key>
<array>
<string>/Users/paveldruzyak/tweets/update.sh</string>
</array>
<key>StandardOutPath</key>
<string>/var/log/grailbird_updater.log</string>
<key>StandardErrorPath</key>
<string>/var/log/grailbird_updater.log</string>
<key>Debug</key>
<true/>
<key>StartInterval</key>
<integer>14400</integer>
</dict>
</plist>
#!/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