[−][src]Crate twitter_stream
Twitter Stream
A library for listening on Twitter Streaming API.
Usage
Add twitter-stream
to your dependencies in your project's Cargo.toml
:
[dependencies]
twitter-stream = "0.10.0-alpha.2"
Overview
Here is a basic example that prints public mentions to @Twitter in JSON format:
use futures::prelude::*; use twitter_stream::Token; let token = Token::new("consumer_key", "consumer_secret", "access_key", "access_secret"); twitter_stream::Builder::filter(token) .track(Some("@Twitter")) .listen() .unwrap() .try_flatten_stream() .try_for_each(|json| { println!("{}", json); future::ok(()) }) .await .unwrap();
Re-exports
pub use crate::error::Error; |
Modules
error | Error types |
rt | Some reexports from |
types | Common types used across the crate. |
Structs
Builder | A builder for |
Credentials | The "credentials" pair defined in RFC 5849 section 1.1. |
FutureTwitterStream | A future returned by constructor methods
which resolves to a |
Token | An OAuth token used to log into Twitter. |
TwitterStream | A listener for Twitter Streaming API. It yields JSON strings returned from the API. |