shindan-maker 0.1.13

A Rust library for interacting with ShindanMaker, the popular personality quiz service.
Documentation

ShindanMaker

A Rust library for interacting with ShindanMaker, the popular personality quiz service.

Features

  • Asynchronous API
  • Multi-domain support (JP, EN, CN, KR, TH)
  • Easy shindan submission and result parsing

Usage

[dependencies]

tokio = { version = "1", features = ["full"] }



# default features: ["segments"]

# optional features: ["html", "full"] ("full" = "segments" + "html")

shindan-maker = { version = "0.1", features = ["segments"] }

Example

Get title

use shindan_maker::{ShindanClient, ShindanDomain};

#[tokio::main]
async fn main() {
    let client = ShindanClient::new(ShindanDomain::En).unwrap();
    let title = client.get_title("1222992").await.unwrap();
    assert_eq!("Reincarnation.", title);
}

Get segments (need "segments" feature)

use shindan_maker::{ShindanClient, ShindanDomain};

#[tokio::main]
async fn main() {
    let client = ShindanClient::new(ShindanDomain::En).unwrap();
    let (segments, title) = client.get_segments_with_title("1222992", "test_user").await.unwrap();
    assert_eq!("Reincarnation.", title);

    println!("Result title: {}", title);
    println!("Result segments: {:#?}", segments);
    println!("Result text: {}", segments);
}

Get HTML string (need "html" feature)

use shindan_maker::{ShindanClient, ShindanDomain};

#[tokio::main]
async fn main() {
    let client = ShindanClient::new(ShindanDomain::En).unwrap();
    let (_html_str, title) = client.get_html_str_with_title("1222992", "test_user").await.unwrap();
    assert_eq!("Reincarnation.", title);
}

License