Skip to content

Ruthenic/wattpad-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wattpad-rs

Unofficial async Rust wrapper around the (various) Wattpad API(s)

Documentation

See docs.rs

Examples

Stories:

use wattpad::Wattpad;

#[tokio::main]
async fn main() {
    let watt = Wattpad::new()
    .await
    .unwrap();
    let story = watt
        .get_story("336149308")
        .await
    .unwrap();

    println!("{}", story.title)
}

Searches:

use wattpad::{SearchSort, SearchType, Wattpad};

#[tokio::main]
async fn main() {
    let watt = Wattpad::new()
    .await
    .unwrap();

    // Text searches
    let text_search = watt
        .search(
            "bendy x reader",
            SearchType::Text,
            SearchSort::Hot,
            30,
        )
        .await
        .unwrap();

    let text_results = text_search.page(0).await.unwrap();

    println!("{}", text_results[0].title)


    // Tag searches
    let tag_search = watt
        .search(
            "bendyxreader,batim",
            SearchType::Text,
            SearchSort::Hot,
            30,
        )
        .await
        .unwrap();

    let tag_results = tag_search.page(0).await.unwrap();

    println!("{}", tag_results[0].title)
}

About

Unofficial async Rust wrapper around the (various) Wattpad API(s)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages