4 releases (breaking)
0.4.0 | Feb 27, 2021 |
---|---|
0.3.0 | Jan 16, 2021 |
0.2.0 | Jul 13, 2020 |
0.1.0 | Jul 4, 2020 |
#3 in #vanity
16KB
110 lines
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(())
}
Dependencies
~7–22MB
~336K SLoC