Module: TweetWatch::Client
Instance Method Summary collapse
Instance Method Details
#client(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tweet_watch/client.rb', line 4 def client( = {}) return @client if .nil? && @client account = TweetWatch.config.get_account([:screen_name]) @client = Twitter::REST::Client.new do |config| config.consumer_key = account.consumer_key config.consumer_secret = account.consumer_secret config.access_token = account.access_token config.access_token_secret = account.access_token_secret end end |
#streaming_client(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tweet_watch/client.rb', line 17 def streaming_client( = {}) return @client if .nil? && @client account = TweetWatch.config.get_account([:screen_name]) @client = Twitter::Streaming::Client.new do |config| config.consumer_key = account.consumer_key config.consumer_secret = account.consumer_secret config.access_token = account.access_token config.access_token_secret = account.access_token_secret end end |