15
|
1 class Tweet
|
|
2 CONFIG = {
|
|
3 :consumer_key => ENV["RT_CONSUMER_KEY"],
|
|
4 :consumer_secret => ENV["RT_CONSUMER_SECRET"],
|
|
5 :access_token => ENV["RT_OAUTH_TOKEN"],
|
|
6 :access_token_secret => ENV["RT_OAUTH_TOKEN_SECRET"]
|
|
7 }
|
|
8
|
|
9 def timeline
|
|
10 @timeline ||= @client.user_timeline(@twitter_id)
|
|
11 end
|
|
12
|
|
13 def initialize(twitter_id)
|
|
14 @client = Twitter::REST::Client.new do |config|
|
21
|
15 CONFIG.each do |cfg_key, cfg_value|
|
|
16 config.public_send("#{cfg_key}=", cfg_value)
|
|
17 end
|
|
18 end
|
15
|
19 @twitter_id = twitter_id
|
|
20 end
|
|
21 end
|