#api #api-bindings #bionic #api-client

bionic_reading_api

非官方的Rust库,用于从其Rapid API获取仿生阅读转换后的字符串。

2个版本

0.1.1 2023年7月30日
0.1.0 2023年6月7日

#4 in #bionic

自定义许可协议GPL-3.0+

19KB
302

cio-img ci-img doc-img

仿生阅读API

非官方的Rust库,用于从其Rapid API获取仿生阅读转换后的字符串。

允许设置API支持的目光固定和眼跳值。有关仿生阅读的更多信息,请参阅官方网站

返回的字符串可以用来直接作为响应中的原始HTML,或者将HTML转换为Markdown格式。

示例

use bionic_reading_api::client::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new("api_key")
        .convert("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.")
        .send()
        .await?;

    let html = res.html().unwrap();
    let markdown = res.markdown().unwrap();

    println!("{html}");
    println!("{markdown}");

    Ok(())
}

依赖项

~7–24MB
~337K SLoC