A Twitter Bot in One Line of Code
synaptify.com
synaptify.com
BTW: great twitter API, and demo of bash as a JSON webservice server implementation language. It repays careful study. Also "bash" has got to be the best name for a hacker's language.
o=onelinebot;u=$o:one.$o;t=twitter.com;h=http://;alias a=alias;a w=while\ read;a c="curl -u$u -d";c track=$o ${h}stream.$t/track.json>t&tail -f t|w t;do echo $t|grep -Eo '"screen_name":"[[:alnum:]]+"'|cut -d\" -f4|w s;do c '' $h$t/friendships/create/$s.json?follow=true;done;done
It's two tweets (280 chars, down from 417) and it's not quite functional... This one will track "onelinebot" instead of "one line." It's basically the same as the original post, but with lots of nasty substitutions.
I figured I'd share, because I really need to get back to some other work - if you can get it working, please share.
curl -F"status=$BASH_COMMAND" -utq_:pass12 -HExpect: 'http://twitter.com/statuses/update.xml'http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.j...
U="onelinebot:one.onelinebot";curl -d 'track=obama' http://stream.twitter.com/track.json -u$U|perl -ne'/\"screen_name\":\"([^"]+)\"/&&`curl -d "" http://twitter.com/friendships/create/$1.json?follow=true -u$U`'