Module: Twitter::API::Timelines
- Included in:
- Client
- Defined in:
- lib/twitter/api/timelines.rb
Overview
Note:
Inspired from twitter-4.5.0/spec/twitter/api/timelines_spec.rb
Instance Method Summary collapse
-
#last_tweet(screen_name) ⇒ Tweet
Get the last tweet given a twitter screen name (the last status).
-
#user_timeline(screen_name, opts) ⇒ Array<Tweet>
Get some user timeline by screen name (last statuses).
Instance Method Details
#last_tweet(screen_name) ⇒ Tweet
Get the last tweet given a twitter screen name (the last status)
38 39 40 41 |
# File 'lib/twitter/api/timelines.rb', line 38 def last_tweet(screen_name) tweets = user_timeline(screen_name, count: 1) tweets.first end |
#user_timeline(screen_name, opts) ⇒ Array<Tweet>
Get some user timeline by screen name (last statuses)
20 21 22 23 24 25 26 27 |
# File 'lib/twitter/api/timelines.rb', line 20 def user_timeline(screen_name, opts) # Sanitize arguments count = opts[:count] || 1 screen_name = screen_name.to_s # Work out results = get_user_timeline_results(screen_name, count) Twitter::Tweet.build_tweets(results) end |