-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
660c1b7
commit 93f7f5d
Showing
6 changed files
with
539 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use futures::prelude::*; | ||
use rs621::{ | ||
client::Client, | ||
tag::{Order, Query}, | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() -> rs621::error::Result<()> { | ||
let client = Client::new("https://e926.net", "MyProject/1.0 (by username on e621)")?; | ||
|
||
println!("Top ten tags by post count!"); | ||
|
||
let result_stream = client | ||
.tag_search(Query::new().limit(1).order(Order::Count)) | ||
.take(10); | ||
|
||
futures::pin_mut!(result_stream); | ||
|
||
while let Some(tag) = result_stream.next().await { | ||
match tag { | ||
Ok(tag) => println!("- {} with a score of {}", tag.name, tag.post_count), | ||
Err(e) => println!("- couldn't load tag: {}", e), | ||
} | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,3 +101,6 @@ pub mod post; | |
|
||
/// Pool management. | ||
pub mod pool; | ||
|
||
/// Tag management. | ||
pub mod tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.