annotate app/models/tweet.rb @ 17:6718f51b34b5

Add readme, copied off original app.
author edogawaconan <me@myconan.net>
date Fri, 05 Sep 2014 20:40:50 +0900
parents 207917e41964
children 6e3ff830e94a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
1 class Tweet
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
2 CONFIG = {
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
3 :consumer_key => ENV["RT_CONSUMER_KEY"],
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
4 :consumer_secret => ENV["RT_CONSUMER_SECRET"],
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
5 :access_token => ENV["RT_OAUTH_TOKEN"],
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
6 :access_token_secret => ENV["RT_OAUTH_TOKEN_SECRET"]
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
7 }
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
8
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
9 def timeline
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
10 @timeline ||= @client.user_timeline(@twitter_id)
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
11 end
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
12
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
13 def initialize(twitter_id)
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
14 @client = Twitter::REST::Client.new do |config|
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
15 CONFIG.each do |cfg_key, cfg_value|
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
16 config.public_send("#{cfg_key}=", cfg_value)
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
17 end
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
18 end
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
19 @twitter_id = twitter_id
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
20 end
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
21 end