mention example

This commit is contained in:
Brandon Thomas committed 2021-05-09 15:12:06 -04:00
1 parent 59c71a82d4
commit 14d99b44b7
1 file changed
+33 -1
+33 -1
View File
@@ -53,7 +53,39 @@ async fn main() -> anyhow::Result<()>
let twitter_access_token = secrets.twitter.verify_access_token().await?;
info!("Streaming...");
/*
Here's an @vocodes mention:
===========================
Tweet: Tweet { coordinates: None, created_at: 2021-05-09T19:00:01Z, current_user_retweet: None,
display_text_range: None, entities: TweetEntities { hashtags: [], symbols: [], urls: [],
user_mentions: [MentionEntity { id: 1297106371238932481, range: (17, 25), name: "vocodes", screen_name: "vocodes" }],
media: None }, extended_entities: None, favorite_count: 0, favorited: Some(false), filter_level: Some(Low),
id: 1391468014755880962, in_reply_to_user_id: None, in_reply_to_screen_name: None, in_reply_to_status_id: None,
lang: Some("en"), place: None, possibly_sensitive: None, quoted_status_id: None, quoted_status: None,
retweet_count: 0, retweeted: Some(false), retweeted_status: None,
source: Some(TweetSource { name: "Twitter Web App", url: "https://mobile.twitter.com" }),
text: "Okay, so I think @vocodes mentions should work", truncated: false,
user: Some(TwitterUser { contributors_enabled: false, created_at: 2020-09-27T02:04:35Z, default_profile: true,
default_profile_image: false, description: Some("This is a bot account for @vocodes /
https://t.co/EDUojadeKa, created by @echelon. You can make it quote you by mentioning it. Please don\'t use this for evil. DEEP FAKE."),
entities: UserEntities { description: UserEntityDetail { urls: [] }, url: None }, favourites_count: 2, follow_request_sent: None,
followers_count: 30, friends_count: 1, geo_enabled: true, id: 1310037441441599488, is_translator: false,
lang: None, listed_count: 1, location: Some("Atlanta, GA"), name: "vocodes bot", profile_background_color: "F5F8FA",
profile_background_image_url: Some(""), profile_background_image_url_https: Some(""), profile_background_tile: Some(false),
profile_banner_url: None, profile_image_url: "http://pbs.twimg.com/profile_images/1310044084506112000/vVJwVAcf_normal.png",
profile_image_url_https: "https://pbs.twimg.com/profile_images/1310044084506112000/vVJwVAcf_normal.png", profile_link_color: "1DA1F2",
profile_sidebar_border_color: "C0DEED", profile_sidebar_fill_color: "DDEEF6", profile_text_color: "333333",
profile_use_background_image: true, protected: false, screen_name: "VocodesBot", show_all_inline_media: None, status: None,
statuses_count: 64, time_zone: None, url: Some("https://vo.codes"), utc_offset: None, verified: false,
withheld_in_countries: Some([]), withheld_scope: None }), withheld_copyright: false, withheld_in_countries: None, withheld_scope: None }
*/
let stream = egg_mode::stream::filter()
.follow(&[1297106371238932481]) // vocodes
.track(&["vocodes"])