Method: Twitter::API#user_timeline

Defined in:
lib/twitter/api.rb

#user_timeline(user, options = {}) ⇒ Array<Twitter::Tweet>

Note:

This method can only return up to 3,200 Tweets.

Returns the 20 most recent Tweets posted by the specified user

Examples:

Return the 20 most recent Tweets posted by @sferik

Twitter.user_timeline('sferik')

Parameters:

  • user (Integer, String, Twitter::User)

    A Twitter user ID, screen name, or object.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :since_id (Integer)

    Returns results with an ID greater than (that is, more recent than) the specified ID.

  • :max_id (Integer)

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer)

    Specifies the number of records to retrieve. Must be less than or equal to 200.

  • :trim_user (Boolean, String, Integer)

    Each tweet returned in a timeline will include a user object with only the author’s numerical ID when set to true, ‘t’ or 1.

  • :exclude_replies (Boolean, String, Integer)

    This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets - this is because the count parameter retrieves that many tweets before filtering out retweets and replies.

  • :contributor_details (Boolean, String, Integer)

    Specifies that the contributors element should be enhanced to include the screen_name of the contributor.

  • :include_rts (Boolean, String, Integer)

    Specifies that the timeline should include native retweets in addition to regular tweets. Note: If you’re using the trim_user parameter in conjunction with include_rts, the retweets will no longer contain a full user object.

Returns:

Raises:

See Also:



1599
1600
1601
# File 'lib/twitter/api.rb', line 1599

def user_timeline(*args)
  objects_from_response(Twitter::Tweet, :get, "/1.1/statuses/user_timeline.json", args)
end