Skip to content

Instantly share code, notes, and snippets.

@decklin
Created June 10, 2014 16:01
Show Gist options
  • Save decklin/c28753f49e1336a3a0e4 to your computer and use it in GitHub Desktop.
Save decklin/c28753f49e1336a3a0e4 to your computer and use it in GitHub Desktop.
#!/bin/sh
today="$(date +%F)"
for f in followers friends; do
case "$f" in
followers) q='.users[].screen_name';;
friends) q='.users[] | .screen_name + "\t" + .name';;
esac
twitpull -v "/$f/list?count=200" "$q" > "$f.$today"
wc -l "$f.$today"
diff -u $(ls -rt "$f".* | tail -2) && rm "$f.$today"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment