Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Created July 17, 2009 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriskowal/148771 to your computer and use it in GitHub Desktop.
Save kriskowal/148771 to your computer and use it in GitHub Desktop.
# apt-get install curl
read -p 'login: ' USER
read -s -p 'password: ' PASSWORD
curl --silent -b twitter-cookie.txt -c twitter-cookie.txt \
--user-agent Mozilla/4.0 \
-d username_or_email="$USER" \
-d password="$PASSWORD" \
-d 'commit=Sign In' \
-o /dev/null \
http://twitter.com/login
curl --silent -b twitter-cookie.txt -c twitter-cookie.txt \
http://twitter.com/statuses/user_timeline/$USER.xml?page=[1-32] \
| grep -E '^ <(created_at|text)>' \
| perl -pe 's/<[^>]+>//g' \
| while read date; read text; do echo "$date\t$text"; done \
> twitter-$USER.txt
# http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment