-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
I'm using the example here: https://github.com/egg-mode-rs/egg-mode/blob/master/examples/stream_filter.rs
Just that I'm entering my token differently in the start function. The same token works fine when fetching tweets using egg_mode::tweet::user_timeline. But when fetching the stream I get 401 unauthorized.
Am I doing something wrong?
`#[tokio::main]
async fn main() {
let con_token = egg_mode::KeyPair::new(CONSUMER_KEY, CONSUMER_SECRET);
println!("Live streaming tweets...");
println!("Ctrl-C to quit\n");
let stream = egg_mode::stream::filter()
.track(&["rustlang"])
.start(&Token::Bearer(BEARERTOKEN.to_string()))
.try_for_each(|m| {
if let StreamMessage::Tweet(tweet) = m {
println!("{}\n{}",tweet.created_at,tweet.text);
} else {
println!("{:?}",m);
}
futures::future::ok(())
});
if let Err(e) = stream.await {
println!("Stream error: {}", e);
println!("Disconnected")
}
}`
Metadata
Metadata
Assignees
Labels
No labels