Created
September 2, 2016 15:31
-
-
Save davetroy/be828928106340aaa35aad5994b94e4b to your computer and use it in GitHub Desktop.
Simple Twitter Updater
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 '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