Skip to main content

Module user

Module user 

Source
Expand description

Structs and methods for pulling user information from Twitter.

Everything in here acts on users in some way, whether looking up user information, finding the relations between two users, or actions like following or blocking a user.

§Types

  • UserID: used as a generic input to many functions, this enum allows you to refer to a user by a numeric ID or by their screen name.
  • Relationship/RelationSource/RelationTarget: returned by relation, these types (Relationship contains the other two) show the ways two accounts relate to each other.
  • RelationLookup/Connection: returned as part of a collection by relation_lookup, these types (RelationLookup contains a Vec<Connection>) shows the ways the authenticated user relates to a specific account.
  • TwitterUser/UserEntities/UserEntityDetail: returned by many functions in this module, these types (TwitterUser contains the other two) describe the content of a user’s profile, and a handful of settings relating to how their profile is displayed.
  • UserSearch: returned by search, this is a stream of search results.

§Functions

§User actions

These functions perform actions to the user’s account. Their use requires that your application request write access to authenticated accounts.

  • block/report_spam/unblock
  • follow/unfollow/update_follow
  • mute/unmute

§Direct lookup

These functions return single users, or groups of users without having to iterate over the results.

  • show
  • lookup/lookup_ids/lookup_names
  • friends_no_retweets
  • relation/relation_lookup

§Cursored lookup

These functions imply that they can return more entries than Twitter is willing to return at once, so they’re delivered in pages. This library takes those paginated results and wraps a stream around them that loads the pages as-needed.

  • search
  • friends_of/friends_ids
  • followers_of/followers_ids
  • blocks/blocks_ids
  • mutes/mutes_ids
  • incoming_requests/outgoing_requests

Structs§

RelationLookup
Represents the relation the authenticated user has to a given account.
RelationSource
Represents relationship settings between two Twitter accounts, from the perspective of the source user.
RelationTarget
Represents relationship settings between two Twitter accounts, from the perspective of the target user.
Relationship
Represents relationship settings between two Twitter accounts.
TwitterUser
Represents a Twitter user.
UserEntities
Container for URL entity information that may be paired with a user’s profile.
UserEntityDetail
Represents a collection of URL entity information paired with a specific user profile field.
UserSearch
Represents an active user search.

Enums§

Connection
Represents the ways a target account can be connected to another account.
UserID
Convenience enum to generalize between referring to an account by numeric ID or by screen name.

Functions§

block
Block the given account with the authenticated user.
blocks
Lookup the users that have been blocked by the authenticated user.
blocks_ids
Lookup the users that have been blocked by the authenticated user, but only return their user IDs.
follow
Follow the given account with the authenticated user, and set whether device notifications should be enabled.
followers_ids
Lookup the users that follow a given account, but only return their user IDs.
followers_of
Lookup the users that follow a given account.
friends_ids
Lookup the users a given account follows, also called their “friends” within the API, but only return their user IDs.
friends_no_retweets
Lookup the user IDs that the authenticating user has disabled retweets from.
friends_of
Lookup the users a given account follows, also called their “friends” within the API.
incoming_requests
Lookup the user IDs who have pending requests to follow the authenticated protected user.
lookup
Look up profile information for several Twitter users.
mute
Mute the given user with the authenticated user.
mutes
Lookup the users that have been muted by the authenticated user.
mutes_ids
Lookup the users that have been muted by the authenticated user, but only return their user IDs.
outgoing_requests
Lookup the user IDs with which the authenticating user has a pending follow request.
relation
Lookup relationship settings between two arbitrary users.
relation_lookup
Lookup the relations between the authenticated user and the given accounts.
report_spam
Block the given account and report it for spam, with the authenticated user.
search
Lookup users based on the given search term.
show
Lookup user information for a single user.
unblock
Unblock the given user with the authenticated user.
unfollow
Unfollow the given account with the authenticated user.
unmute
Unmute the given user with the authenticated user.
update_follow
Update notification settings and reweet visibility for the given user.