Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/craftspider/nanowrimo-rs
Access to the NanoWrimo API, in all its forms
https://github.com/craftspider/nanowrimo-rs
Last synced: about 1 month ago
JSON representation
Access to the NanoWrimo API, in all its forms
- Host: GitHub
- URL: https://github.com/craftspider/nanowrimo-rs
- Owner: CraftSpider
- License: apache-2.0
- Created: 2020-11-24T03:33:34.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T19:48:24.000Z (over 3 years ago)
- Last Synced: 2024-09-13T15:21:26.863Z (2 months ago)
- Language: Rust
- Size: 108 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# nanowrimo
[![crates.io](https://img.shields.io/crates/v/nanowrimo.svg)](https://crates.io/crates/nanowrimo)
[![Documentation](https://docs.rs/nanowrimo/badge.svg)](https://docs.rs/nanowrimo)
[![MIT/Apache-2 licensed](https://img.shields.io/crates/l/nanowrimo.svg)](./LICENSE-APACHE)An easy-to use NanoWrimo API client for Rust
- Built on reqwest
- Supports both anonymous and logged-in access## Example
This example uses [Tokio](https://tokio.rs)
```toml
[dependencies]
nanowrimo = "0.2"
tokio = { version = "0.2", features = ["full"] }
``````rust,no_run
use nanowrimo::{NanoClient};#[tokio::main]
async fn main() {
let client = NanoClient::new_user("username", env!("NANO_PASSWORD"))
.await
.expect("Couldn't create logged in NanoClient");
let user = client.current_user()
.await
.expect("Couldn't get current user")
.data;
let data = &user.data;
println!("User ID: {}", user.id())
println!("User Bio: {}", data.bio);
println!("Avatar: {}", data.avatar);
}
```## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.