module TweetWatch::Client

Public Instance Methods

client(options = {}) click to toggle source
# File lib/tweet_watch/client.rb, line 4
def client(options = {})
  return @client if options.nil? && @client  
   
  account = TweetWatch.config.get_account(options[: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 = {}) click to toggle source
# File lib/tweet_watch/client.rb, line 17
def streaming_client(options = {})
  return @client if options.nil? && @client
  
  account = TweetWatch.config.get_account(options[: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