Crates.io | downloads |
lib.rs | downloads |
version | 0.0.2 |
source | src |
created_at | 2019-08-29 06:19:48.494049 |
updated_at | 2019-08-29 13:49:27.91806 |
description | All My Crates Downloads |
homepage | |
repository | https://github.com/downloads-rs.git |
max_upload_size | |
id | 160580 |
size | 25,565 |
WIP
A lib for check my-crates all downloads.
Add dependencies
[dependencies]
downloads = "0.0.2"
Example
extern crate downloads;
use downloads::*;
fn main() {
let mut totals = 0;
let user_id = "56717";
let v: Result<Value> = fetch(user_id);
if let Ok(x) = v {
if let Some(arr) = x.as_array() {
for i in arr {
println!("crate name: {}", i["name"]);
println!("downloads: {}",i["downloads"]);
println!("\n");
totals += i["downloads"].as_u64().unwrap() as usize;
}
}
}
println!("Total Downloads: {}", totals);
}
Steps
crates?user_id=56717
, double click, will see all your user info.