comparison app/models/tweet.rb @ 15:207917e41964

Add tweets~ Feature is now on par with the thing it's replacing.
author edogawaconan <me@myconan.net>
date Fri, 05 Sep 2014 20:37:25 +0900
parents
children 6e3ff830e94a
comparison
equal deleted inserted replaced
14:aad3b253ffd5 15:207917e41964
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|
15 CONFIG.each do |cfg_key, cfg_value|
16 config.public_send("#{cfg_key}=", cfg_value)
17 end
18 end
19 @twitter_id = twitter_id
20 end
21 end