Twitter from the Command Line
I’m trying to incorporate Twitter into my workflow for Jekyll by allowing any new posts to the site to subsequently update Twitter. The script I’ve hacked together so far is very basic, and doesn’t yet do the job, but I thought I’d share what I have thus far.
Pretty easy to get this working. The script requires a couple of simple includes:
Then register your app to authenticate your new Ruby command line Twitter script to use OAuth. Write down the consumer and access public and private keys; you’ll need them to get things working. Once you’re ready, simply plug in your keys into this script:
You can run this by calling up Ruby or make the script executable and edit your bash PATH in your .bashrc file (don’t forget to refresh .bashrc after you modify it).
You can update Twitter by writing: