I just wrote one of the best one-line bash scripts of all time.
ALL TIME! curl -s -u Frank__Booth:password -d “track=heineken” http://stream.twitter.com/track.xml | grep “/screen_name” | grep -v Frank__Booth | sed -e ‘s/[^0-9a-zA-Z]//g’ | sed -e ‘s/screenname//g’ | xargs -I ‘{}’ curl –basic –user Frank__Booth:password –data status=”@{} Heineken? Fuck that shit! PABST BLUE RIBBON” http://twitter.com/statuses/update.xml
Twitter JSON stream parser
So recently I’ve had occasion to parse the Twitter JSON stream, specifically the spritzer stream for data mining purposes. Turns out this is a pretty difficult problem to solve in most languages. So here’s my Alexandrian solution to this particular Gordian knot, in Bash, because that’s just how I roll. curl -s –basic –user username:password …

Comments