Last active
November 5, 2017 20:24
-
-
Save jjasghar/c3db518d3e86ad49820762c65736a160 to your computer and use it in GitHub Desktop.
salute to service twitter.rb
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 "net/http" | |
require "uri" | |
require 'twitter' | |
# Create an app.twitter.com fill these out | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "FAKE" | |
config.consumer_secret = "VERYFAKEz2eQsYnUNXVL7S0kF0Bzh" | |
config.access_token = "SOMENUMEBRE-66oauaoeu" | |
config.access_token_secret = "NOPENOTME" | |
end | |
uri = URI.parse("http://namerr.herokuapp.com/api/v1") | |
# Shortcut | |
http = Net::HTTP.new(uri.host, uri.port) | |
response = http.request(Net::HTTP::Get.new(uri.request_uri)) | |
client.update("#{response.body} #SaluteToService") | |
# Set your crontab to * * * * * ruby script.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gem install twitter