Skip to content

Instantly share code, notes, and snippets.

@icco
Forked from dominiek/gist:193517
Created September 25, 2009 21:36
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 icco/193865 to your computer and use it in GitHub Desktop.
Save icco/193865 to your computer and use it in GitHub Desktop.
One line bash twitter bot
curl -d 'track=one line' http://stream.twitter.com/track.json -uonelinebot:one.onelinebot > tweets.json 2> /dev/null & tail -f tweets.json | \
while read tweet; do echo $tweet | \
grep -E -o '"screen_name":"[[:alnum:]]+"' | cut -d '"' -f 4 | while read screen_name; do \
echo "following: $screen_name"; curl -d '' http://twitter.com/friendships/create/$screen_name.json?follow=true -uonelinebot:one.onelinebot; \
done ; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment