Module: Twitter::REST::Timelines
Overview
Methods for accessing timelines
Constant Summary collapse
- DEFAULT_TWEETS_PER_REQUEST =
Default number of tweets per request
20- MAX_TWEETS_PER_REQUEST =
Maximum tweets per request
200
Constants included from Utils
Instance Method Summary collapse
-
#home_timeline(options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent Tweets from the authenticating user’s timeline.
-
#mentions_timeline(options = {}) ⇒ Array<Twitter::Tweet>
(also: #mentions)
Returns the 20 most recent mentions for the authenticating user.
-
#retweeted_by_me(options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent retweets posted by the authenticating user.
-
#retweeted_by_user(user, options = {}) ⇒ Array<Twitter::Tweet>
(also: #retweeted_by)
Returns the 20 most recent retweets posted by the specified user.
-
#retweeted_to_me(options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent retweets posted by followed users.
-
#retweets_of_me(options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent tweets that have been retweeted by others.
-
#user_timeline(user, options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent Tweets posted by the specified user.
Methods included from Utils
Instance Method Details
#home_timeline(options = {}) ⇒ Array<Twitter::Tweet>
This method can only return up to 800 Tweets, including retweets.
Returns the 20 most recent Tweets from the authenticating user’s timeline
137 138 139 |
# File 'lib/twitter/rest/timelines.rb', line 137 def home_timeline( = {}) perform_get_with_objects("/1.1/statuses/home_timeline.json", , Tweet) end |
#mentions_timeline(options = {}) ⇒ Array<Twitter::Tweet> Also known as: mentions
This method can only return up to 800 Tweets.
Returns the 20 most recent mentions for the authenticating user
32 33 34 |
# File 'lib/twitter/rest/timelines.rb', line 32 def mentions_timeline( = {}) perform_get_with_objects("/1.1/statuses/mentions_timeline.json", , Tweet) end |
#retweeted_by_me(options = {}) ⇒ Array<Twitter::Tweet>
This method can only return up to 3,200 Tweets.
Returns the 20 most recent retweets posted by the authenticating user
112 113 114 115 116 |
# File 'lib/twitter/rest/timelines.rb', line 112 def retweeted_by_me( = {}) retweets_from_timeline() do |opts| user_timeline(opts) end end |
#retweeted_by_user(user, options = {}) ⇒ Array<Twitter::Tweet> Also known as: retweeted_by
This method can only return up to 3,200 Tweets.
Returns the 20 most recent retweets posted by the specified user
84 85 86 87 88 |
# File 'lib/twitter/rest/timelines.rb', line 84 def retweeted_by_user(user, = {}) retweets_from_timeline() do |opts| user_timeline(user, opts) end end |
#retweeted_to_me(options = {}) ⇒ Array<Twitter::Tweet>
This method can only return up to 800 Tweets, including retweets.
Returns the 20 most recent retweets posted by followed users
159 160 161 162 163 |
# File 'lib/twitter/rest/timelines.rb', line 159 def retweeted_to_me( = {}) retweets_from_timeline() do |opts| home_timeline(opts) end end |
#retweets_of_me(options = {}) ⇒ Array<Twitter::Tweet>
Returns the 20 most recent tweets that have been retweeted by others
181 182 183 |
# File 'lib/twitter/rest/timelines.rb', line 181 def retweets_of_me( = {}) perform_get_with_objects("/1.1/statuses/retweets_of_me.json", , Tweet) end |
#user_timeline(user, options = {}) ⇒ Array<Twitter::Tweet>
This method can only return up to 3,200 Tweets.
Returns the 20 most recent Tweets posted by the specified user
61 62 63 |
# File 'lib/twitter/rest/timelines.rb', line 61 def user_timeline(*args) objects_from_response_with_user(Tweet, :get, "/1.1/statuses/user_timeline.json", args) end |