Skip to content

Repository files navigation

pullcaps

crates.ioDocumentationMIT/Apache-2 licensedCI

A convenient, opinionated, asynchronous client for the PushShift API.

Example

This library is built on top of Tokio, and currently produces streams from the futures crate. An example Cargo.toml could be:

[dependencies]
futures = { version = "0.3" }
pullcaps = { version = "0.1" }
tokio = { version = "1", features = ["full"] }

A small example is then:

use pullcaps::{Client,Filter};use futures::StreamExt;#[tokio::main]asyncfnmain(){let client = Client::new();// Get the five most recent posts in /r/askredditletmut posts = client.get_posts(Filter::new().subreddit("askreddit")).await.take(5);whileletSome(post) = posts.next().await{println!("url: {}", post.content_url);}}

For additional examples see the documentation.

License

Licensed under either of

About

A convenient, opinionated, asynchronous client for the PushShift API

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages