Last active
August 29, 2015 14:01
-
-
Save h0lyalg0rithm/9be3c1d59ba6bb6b9878 to your computer and use it in GitHub Desktop.
Twitter gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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