Crates.io | steam-resolve-vanity |
lib.rs | steam-resolve-vanity |
version | 0.4.0 |
source | src |
created_at | 2020-07-04 15:18:03.949874 |
updated_at | 2021-02-27 15:05:26.883047 |
description | Resolve steam vanity urls |
homepage | |
repository | https://github.com/icewind1991/steam-resolve-vanity |
max_upload_size | |
id | 261337 |
size | 51,231 |
Resolve steam vanity urls
use std::env::args;
use steam_resolve_vanity::resolve_vanity_url;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let key = dotenv::var("STEAM_API_KEY")?;
let mut args = args();
let binary = args.next().unwrap(); // first argument is binary
if let Some(vanity) = args.next() {
if let Some(steam_id) = resolve_vanity_url(&vanity, &key).await? {
println!("{}", steam_id.steam3());
} else {
println!("No steamid found for vanity");
}
} else {
eprintln!("usage {} <vanity>", binary);
}
Ok(())
}