Skip to content

Instantly share code, notes, and snippets.

@h0lyalg0rithm
Last active August 29, 2015 14:01
Show Gist options
  • Save h0lyalg0rithm/9be3c1d59ba6bb6b9878 to your computer and use it in GitHub Desktop.
Save h0lyalg0rithm/9be3c1d59ba6bb6b9878 to your computer and use it in GitHub Desktop.
Twitter gem
require 'twitter'
require 'unirest'
client = Twitter::REST::Client.new do |config|
config.consumer_key = "CONSUMER KEY"
config.consumer_secret = "CONSUMER SECRET"
config.access_token_secret = "ACCESS TOKEN SECRET"
config.access_token = "ACCESS TOKEN"
end
client.update("This tweet is brought to you by the twitter gem")
while true do
response = Unirest.get("http://api.icndb.com/jokes/random")
client.update("#{response.body["value"]["joke"]} " + "#anglehackdubai @thecribb")
sleep rand(60..3600)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment