Skip to content

Instantly share code, notes, and snippets.

@jjasghar jjasghar/app.rb
Last active Nov 5, 2017

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.