Module: Twitter::Client::Timelines
- Included in:
- Twitter::Client
- Defined in:
- lib/twitter/client/timelines.rb
Overview
Defines methods related to timelines
Instance Method Summary collapse
-
#home_timeline(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent statuses, including retweets if they exist, posted by the authenticating user and the users they follow.
-
#media_timeline(user, options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent images posted by the specified user.
-
#mentions(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent mentions (statuses containing @username) for the authenticating user.
-
#network_timeline(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent statuses from the authenticating user's network.
-
#public_timeline(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent statuses, including retweets if they exist, from non-protected users.
-
#retweeted_by(*args) ⇒ Object
Returns the 20 most recent retweets posted by the specified user.
-
#retweeted_to(*args) ⇒ Object
Returns the 20 most recent retweets posted by users the specified user follows.
-
#retweets_of_me(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
-
#user_timeline(user, options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent statuses posted by the specified user.
Instance Method Details
#home_timeline(options = {}) ⇒ Array<Twitter::Status>
This method can only return up to 800 statuses, including retweets.
Returns the 20 most recent statuses, including retweets if they exist, posted by the authenticating user and the users they follow
27 28 29 30 31 |
# File 'lib/twitter/client/timelines.rb', line 27 def home_timeline(={}) get("/1/statuses/home_timeline.json", ).map do |status| Twitter::Status.new(status) end end |
#media_timeline(user, options = {}) ⇒ Array<Twitter::Status>
This method can only return up to the 100 most recent images.
Images will not be returned from tweets posted before January 1, 2010.
Returns the 20 most recent images posted by the specified user
230 231 232 233 234 235 236 237 238 |
# File 'lib/twitter/client/timelines.rb', line 230 def media_timeline(*args) = args.last.is_a?(Hash) ? args.pop : {} if user = args.pop .merge_user!(user) end get("/1/statuses/media_timeline.json", ).map do |status| Twitter::Status.new(status) end end |
#mentions(options = {}) ⇒ Array<Twitter::Status>
This method can only return up to 800 statuses. If the :include_rts option is set, only 800 statuses, including retweets if they exist, can be returned.
Returns the 20 most recent mentions (statuses containing @username) for the authenticating user
51 52 53 54 55 |
# File 'lib/twitter/client/timelines.rb', line 51 def mentions(={}) get("/1/statuses/mentions.json", ).map do |status| Twitter::Status.new(status) end end |
#network_timeline(options = {}) ⇒ Array<Twitter::Status>
Undocumented
Returns the 20 most recent statuses from the authenticating user's network
257 258 259 260 261 |
# File 'lib/twitter/client/timelines.rb', line 257 def network_timeline(={}) get("/i/statuses/network_timeline.json", ).map do |status| Twitter::Status.new(status) end end |
#public_timeline(options = {}) ⇒ Array<Twitter::Status>
The public timeline is cached for 60 seconds. Requesting more frequently than that will not return any more data, and will count against your rate limit usage.
Returns the 20 most recent statuses, including retweets if they exist, from non-protected users
69 70 71 72 73 |
# File 'lib/twitter/client/timelines.rb', line 69 def public_timeline(={}) get("/1/statuses/public_timeline.json", ).map do |status| Twitter::Status.new(status) end end |
#retweeted_by(options = {}) ⇒ Array<Twitter::Status> #retweeted_by(user, options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent retweets posted by the specified user
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/twitter/client/timelines.rb', line 106 def retweeted_by(*args) = args.last.is_a?(Hash) ? args.pop : {} if user = args.pop .merge_user!(user) get("/1/statuses/retweeted_by_user.json", ) else get("/1/statuses/retweeted_by_me.json", ) end.map do |status| Twitter::Status.new(status) end end |
#retweeted_to(options = {}) ⇒ Array<Twitter::Status> #retweeted_to(user, options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent retweets posted by users the specified user follows
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/twitter/client/timelines.rb', line 149 def retweeted_to(*args) = args.last.is_a?(Hash) ? args.pop : {} if user = args.pop .merge_user!(user) get("/1/statuses/retweeted_to_user.json", ) else get("/1/statuses/retweeted_to_me.json", ) end.map do |status| Twitter::Status.new(status) end end |
#retweets_of_me(options = {}) ⇒ Array<Twitter::Status>
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others
177 178 179 180 181 |
# File 'lib/twitter/client/timelines.rb', line 177 def retweets_of_me(={}) get("/1/statuses/retweets_of_me.json", ).map do |status| Twitter::Status.new(status) end end |
#user_timeline(user, options = {}) ⇒ Array<Twitter::Status>
This method can only return up to 3200 statuses. If the :include_rts option is set, only 3200 statuses, including retweets if they exist, can be returned.
Returns the 20 most recent statuses posted by the specified user
203 204 205 206 207 208 209 210 211 |
# File 'lib/twitter/client/timelines.rb', line 203 def user_timeline(*args) = args.last.is_a?(Hash) ? args.pop : {} if user = args.pop .merge_user!(user) end get("/1/statuses/user_timeline.json", ).map do |status| Twitter::Status.new(status) end end |