Skip to content

Instantly share code, notes, and snippets.

@JoshReedSchramm
Created August 18, 2011 23:11
Show Gist options
  • Save JoshReedSchramm/1155513 to your computer and use it in GitHub Desktop.
Save JoshReedSchramm/1155513 to your computer and use it in GitHub Desktop.
Speaking Twitter in Bash
curl http://twitter.com/search.json?q=%23burningriverdevs | grep -Po '"text":.*?[^\\]",' | sed -e 's/\"text\"://g' | sed -e 's/@burningriverdev//g' | sed -e 's/#burningriverdevs/burning\ river\ devs/g'| sed -e 's/RT\ ://g' | sed -e 's/\\\u201C//g' | say
@joecannatti
Copy link

You can make this perform much better by only spawning one sed process and avoiding opening all those pipes. Unix can be clean too! :)

sed -e 's/one/1/' -e 's/two/2/' -e 's/three/3/'

instead of

sed -e 's/one/1/' | sed -e 's/two/2/' | sed -e 's/three/3/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment