Method: Twitter::API::Timelines#last_tweet

Defined in:
lib/twitter/api/timelines.rb

#last_tweet(screen_name) ⇒ Tweet

Get the last tweet given a twitter screen name (the last status)

Examples:

Twitter::Client.new.last_tweet('DolarBlue')
#=> #<Twitter::Tweet:0x011.. @id="308609..., @text="Dolar Paralelo: $7,84.....

Parameters:

  • screen_name (String)

    the twitter user slug

Returns:

  • (Tweet)

    the Tweet object



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