A convenient, opinionated, asynchronous client for the PushShift API.
This library is built on top of Tokio, and currently produces streams
from the futures crate. An example Cargo.toml
could be:
toml
[dependencies]
futures = { version = "0.3" }
pullcaps = { version = "0.1" }
tokio = { version = "1", features = ["full"] }
A small example is then:
```rust use pullcaps::{Client, Filter}; use futures::StreamExt;
async fn main() { let client = Client::new();
// Get the five most recent posts in /r/askreddit let mut posts = client.getposts(Filter::new().subreddit("askreddit")).await.take(5); while let Some(post) = posts.next().await { println!("url: {}", post.contenturl); } } ```
For additional examples see the documentation.
Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)