Skip to content

Instantly share code, notes, and snippets.

@davetroy
Created September 2, 2016 15:31
Show Gist options
  • Save davetroy/be828928106340aaa35aad5994b94e4b to your computer and use it in GitHub Desktop.
Save davetroy/be828928106340aaa35aad5994b94e4b to your computer and use it in GitHub Desktop.
Simple Twitter Updater
require 'yaml'
require 'twitter'
class TwitterOutput
def initialize
@client = client
end
def client
creds = YAML.load_file('creds.yml').values.first
p creds
Twitter::REST::Client.new do |config|
config.consumer_key = creds[:consumer_key]
config.consumer_secret = creds[:consumer_secret]
config.access_token = creds[:access_token]
config.access_token_secret = creds[:access_token_secret]
end
end
def update(text)
@client.update(text)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment