Struct egg_mode::tweet::Tweet
[−]
[src]
pub struct Tweet { pub coordinates: Option<(f64, f64)>, pub created_at: DateTime<Utc>, pub current_user_retweet: Option<u64>, pub display_text_range: Option<(usize, usize)>, pub entities: TweetEntities, pub extended_entities: Option<ExtendedTweetEntities>, pub favorite_count: i32, pub favorited: Option<bool>, pub id: u64, pub in_reply_to_user_id: Option<u64>, pub in_reply_to_screen_name: Option<String>, pub in_reply_to_status_id: Option<u64>, pub lang: String, pub place: Option<Place>, pub possibly_sensitive: Option<bool>, pub quoted_status_id: Option<u64>, pub quoted_status: Option<Box<Tweet>>, pub retweet_count: i32, pub retweeted: Option<bool>, pub retweeted_status: Option<Box<Tweet>>, pub source: TweetSource, pub text: String, pub truncated: bool, pub user: Option<Box<TwitterUser>>, pub withheld_copyright: bool, pub withheld_in_countries: Option<Vec<String>>, pub withheld_scope: Option<String>, }
Represents a single status update.
The fields present in this struct can be mainly split up based on the context they're present for.
Base Tweet Info
This information is the basic information inherent to all tweets, regardless of context.
text
id
created_at
user
source
favorite_count
/retweet_count
lang
, though third-party clients usually don't surface this at a user-interface level. Twitter Web uses this to create machine-translations of the tweet.coordinates
/place
display_text_range
truncated
Perspective-based data
This information depends on the authenticated user who called the data. These are left as Options because certain contexts where the information is pulled either don't have an authenticated user to compare with, or don't have to opportunity to poll the user's interactions with the tweet.
favorited
retweeted
current_user_retweet
Replies
This information is only present when the tweet in question is marked as being a reply to another tweet, or when it's threaded into a chain from the same user.
in_reply_to_user_id
/in_reply_to_screen_name
in_reply_to_status_id
Retweets and Quote Tweets
This information is only present when the tweet in question is a native retweet or is a "quote
tweet" that references another tweet by linking to it. These fields allow you to reference the
parent tweet without having to make another call to show
.
retweeted_status
quoted_status
/quoted_status_id
Media
As a tweet can attach an image, GIF, or video, these fields allow you to access information
about the attached media. Note that polls are not surfaced to the Public API at the time of this
writing (2016-09-01). For more information about how to use attached media, see the
documentation for MediaEntity
.
entities
(note that this also contains information about hyperlinks, user mentions, and hashtags in addition to a picture/thumbnail)extended_entities
: This field is only present for tweets with attached media, and houses more complete media information, in the case of a photo set, video, or GIF. For videos and GIFs, note thatentities
will only contain a thumbnail, and the actual video links will be in this field. For tweets with more than one photo attached,entities
will only contain the first photo, and this field will contain all of them.possibly_sensitive
withheld_copyright
withheld_in_countries
withheld_scope
Fields
coordinates: Option<(f64, f64)>
If present, the location coordinate attached to the tweet, as a (latitude, longitude) pair.
created_at: DateTime<Utc>
UTC timestamp from when the tweet was posted.
current_user_retweet: Option<u64>
If the authenticated user has retweeted this tweet, contains the ID of the retweet.
display_text_range: Option<(usize, usize)>
If this tweet is an extended tweet with "hidden" metadata and entities, contains the byte offsets between which the "displayable" tweet text is.
entities: TweetEntities
Link, hashtag, and user mention information extracted from the tweet text.
extended_entities: Option<ExtendedTweetEntities>
Extended media information attached to the tweet, if media is available.
If a tweet has a photo, set of photos, gif, or video attached to it, this field will be
present and contain the real media information. The information available in the media
field of entities
will only contain the first photo of a set, or a thumbnail of a gif or
video.
favorite_count: i32
"Approximately" how many times this tweet has been liked by users.
favorited: Option<bool>
Indicates whether the authenticated user has liked this tweet.
id: u64
Numeric ID for this tweet.
in_reply_to_user_id: Option<u64>
If the tweet is a reply, contains the ID of the user that was replied to.
in_reply_to_screen_name: Option<String>
If the tweet is a reply, contains the screen name of the user that was replied to.
in_reply_to_status_id: Option<u64>
If the tweet is a reply, contains the ID of the tweet that was replied to.
lang: String
Can contain a language ID indicating the machine-detected language of the text, or "und" if no language could be detected.
place: Option<Place>
When present, the Place
that this tweet is associated with (but not necessarily where it
originated from).
possibly_sensitive: Option<bool>
If the tweet has a link, indicates whether the link may contain content that could be identified as sensitive.
quoted_status_id: Option<u64>
If this tweet is quoting another by link, contains the ID of the quoted tweet.
quoted_status: Option<Box<Tweet>>
If this tweet is quoting another by link, contains the quoted tweet.
retweet_count: i32
The number of times this tweet has been retweeted (with native retweets).
retweeted: Option<bool>
Indicates whether the authenticated user has retweeted this tweet.
retweeted_status: Option<Box<Tweet>>
If this tweet is a retweet, then this field contains the original status information.
The separation between retweet and original is so that retweets can be recalled by deleting the retweet, and so that liking a retweet results in an additional notification to the user who retweeted the status, as well as the original poster.
source: TweetSource
The application used to post the tweet.
text: String
The text of the tweet. For "extended" tweets, opening reply mentions and/or attached media or quoted tweet links do not count against character count, so this could be longer than 140 characters in those situations.
truncated: bool
Indicates whether this tweet is a truncated "compatibility" form of an extended tweet whose full text is longer than 140 characters.
user: Option<Box<TwitterUser>>
The user who posted this tweet. This field will be absent on tweets included as part of a
TwitterUser
.
withheld_copyright: bool
If present and true
, indicates that this tweet has been withheld due to a DMCA complaint.
withheld_in_countries: Option<Vec<String>>
If present, contains two-letter country codes indicating where this tweet is being withheld.
The following special codes exist:
XX
: Withheld in all countriesXY
: Withheld due to DMCA complaint.
withheld_scope: Option<String>
If present, indicates whether the content being withheld is the status
or the user
.