Module: TwitterFriendly::REST::Timelines
- Included in:
- API
- Defined in:
- lib/twitter_friendly/rest/timelines.rb
Constant Summary collapse
- MAX_TWEETS_PER_REQUEST =
200
Instance Method Summary collapse
- #home_timeline(options = {}) ⇒ Object
- #mentions_timeline(options = {}) ⇒ Object
- #user_timeline(*args) ⇒ Object
Instance Method Details
#home_timeline(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/twitter_friendly/rest/timelines.rb', line 7 def home_timeline( = {}) = {include_rts: true, count: MAX_TWEETS_PER_REQUEST}.merge() if [:count] <= MAX_TWEETS_PER_REQUEST @twitter.home_timeline()&.map(&:attrs) else fetch_tweets_with_max_id(__method__, MAX_TWEETS_PER_REQUEST, ) end end |
#mentions_timeline(options = {}) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/twitter_friendly/rest/timelines.rb', line 26 def mentions_timeline( = {}) = {include_rts: true, count: MAX_TWEETS_PER_REQUEST}.merge() if [:count] <= MAX_TWEETS_PER_REQUEST @twitter.mentions_timeline()&.map(&:attrs) else fetch_tweets_with_max_id(__method__, MAX_TWEETS_PER_REQUEST, ) end end |
#user_timeline(*args) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/twitter_friendly/rest/timelines.rb', line 16 def user_timeline(*args) = {include_rts: true, count: MAX_TWEETS_PER_REQUEST}.merge(args.) args << if [:count] <= MAX_TWEETS_PER_REQUEST @twitter.user_timeline(*args)&.map(&:attrs) else fetch_tweets_with_max_id(__method__, MAX_TWEETS_PER_REQUEST, *args) end end |