Skip to content

Instantly share code, notes, and snippets.

@jjasghar
Last active November 5, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjasghar/c3db518d3e86ad49820762c65736a160 to your computer and use it in GitHub Desktop.
Save jjasghar/c3db518d3e86ad49820762c65736a160 to your computer and use it in GitHub Desktop.
salute to service twitter.rb
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
@jjasghar
Copy link
Author

jjasghar commented Nov 5, 2017

gem install twitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment