My friend was stuck without an internet connection during this year's State of the Union. I wanted to make sure we could all share our hot takes and direct quotes with them, so I made this 'lil distribution channel in the ten minutes before the speech.
I wrote these docs, and this script, in a total of ten minutes. It may be a bit rough. I'll be making updates to simplify and clarify in a few minutes. If you have any questions, leave a comment on the Gist, or get at me on Twitter -- I'm glad to help!
For SMS messaging, I used the awesome Twilio SMS APIs. To post to Twitter, I used the one, the only Twitter API.
- Install the Twilio and Twitter gems. You may need to run these with
sudo
gem install twitter gem install twilio-ruby
- Set all API keys and config placeholders
- Run
irb
in your shell - In
irb
,require_relative 'sotu'
- Pass strings to the
Sotu::send
function, and watch it tweet/text!
Good question. The Sotu
module groups together the two API clients, and the actions I want them to take. It's an example of scoping, which is particularly unique (in my estimation) in Ruby.
To read more about scoping and inheritance in Ruby, check out the excellent Learn Ruby the Hard Way book!