Crate dot4ch[−][src]
Expand description
dot4ch
dot4ch is a convenient wrapper library around 4chan’s API.
This library can fetch and update:
- Posts
- Threads
- Catalog
While respecting 4chan’s:
- GET 1 second-per-request cooldown.
If-Modified-Since
headers with update requests.- 10 second cooldown with
Thread
,Catalog
andBoard
update requests.
Example: Getting an image from the OP of a thread
#[tokio::main] async fn main() { let mut client = Client::new(); let board = "g"; let post_id = 81743559; let thread = Thread::new(&mut client, board, post_id).unwrap(); let post = thread.op(); println!("{}", post.image_url().unwrap()); }
Modules
board | A cache of the entire board. |
post | Holds an information of a single post |
thread | Contains information about a 4chan thread. |
threadlist | A list of all avaliable threads in a Board |
Structs
Client | The main client for accessing API.
Handles updates, board and |
Traits
Update | Update trait specifies if something can be updated or not. |
Functions
header | Returns an If-Modified-Since header to be used in requests. |