No description
  • Rust 89.6%
  • Nix 10.4%
Find a file
2021-01-16 23:17:42 +01:00
examples add method to get vanity url by steamid 2020-07-13 23:34:32 +02:00
src add method to get vanity url by steamid 2020-07-13 23:34:32 +02:00
.gitignore initial version 2020-07-04 17:17:31 +02:00
Cargo.toml 0.3 with tokio 1.0 support 2021-01-16 23:17:42 +01:00
LICENSE-APACHE initial version 2020-07-04 17:17:31 +02:00
LICENSE-MIT initial version 2020-07-04 17:17:31 +02:00
README.md initial version 2020-07-04 17:17:31 +02:00

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(())
}