steam-resolve-vanity

Crates.iosteam-resolve-vanity
lib.rssteam-resolve-vanity
version0.4.0
sourcesrc
created_at2020-07-04 15:18:03.949874
updated_at2021-02-27 15:05:26.883047
descriptionResolve steam vanity urls
homepage
repositoryhttps://github.com/icewind1991/steam-resolve-vanity
max_upload_size
id261337
size51,231
Robin Appelman (icewind1991)

documentation

README

Steam-resolve-vanity

Resolve steam vanity urls

Usage

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(())
}
Commit count: 6

cargo fmt