Skip to content

Commit

Permalink
Fix YAML require. Update Twitter code.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdvdijk committed Jul 2, 2016
1 parent 7ef1bbd commit a14c8ce
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/quotes/tweeter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'yaml'

module Quotes
class Tweeter

Expand All @@ -14,19 +16,19 @@ def initialize(config_file = "config.yml")

def tweet
quote = @database.next
Twitter.update(quote)
@twitter.update(quote)
@facebook.feed!(:message => quote)
end

private

# see README
def setup_twitter(settings)
Twitter.configure do |config|
config.consumer_key = settings["consumer_key"]
config.consumer_secret = settings["consumer_secret"]
config.oauth_token = settings["oauth_token"]
config.oauth_token_secret = settings["oauth_token_secret"]
@twitter = Twitter::REST::Client.new do |config|
config.consumer_key = settings["consumer_key"]
config.consumer_secret = settings["consumer_secret"]
config.access_token = settings["oauth_token"]
config.access_token_secret = settings["oauth_token_secret"]
end
end

Expand Down

0 comments on commit a14c8ce

Please sign in to comment.