Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/comfyfluffy/pixivcrab-rs
A pixiv AppAPI in Rust.
https://github.com/comfyfluffy/pixivcrab-rs
pixiv pixiv-api
Last synced: about 2 months ago
JSON representation
A pixiv AppAPI in Rust.
- Host: GitHub
- URL: https://github.com/comfyfluffy/pixivcrab-rs
- Owner: ComfyFluffy
- License: mit
- Created: 2021-10-31T13:10:57.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-28T05:49:22.000Z (about 2 years ago)
- Last Synced: 2024-03-15T15:07:48.102Z (10 months ago)
- Topics: pixiv, pixiv-api
- Language: Rust
- Homepage:
- Size: 43.9 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pixivcrab
A pixiv AppAPI in Rust.
## Example
```rust
use pixivcrab::{AppApi, AppApiConfig, AuthMethod};
use reqwest::ClientBuilder;
use std::env::var;#[tokio::test]
async fn example() {
let mut config = AppApiConfig::default();
config.set_language("en-us").unwrap();
let api = AppApi::new_with_config(
AuthMethod::RefreshToken(var("PIXIV_REFRESH_TOKEN").unwrap()),
ClientBuilder::new(),
config,
)
.unwrap();
let user = api.user_detail("123456").await.unwrap();
println!("{:?}", user);
let mut pager = api.illust_bookmarks("123456", false);
while let Some(r) = pager.next().await.unwrap() {
for i in r.illusts {
println!("{} {:?}", i.title, i.tags);
}
}
}
```