mirror of
https://codeberg.org/icewind/steam-resolve-vanity.git
synced 2026-06-03 17:14:06 +02:00
initial version
This commit is contained in:
parent
6d3e1c7a7b
commit
84e8419179
7 changed files with 367 additions and 7 deletions
29
README.md
Normal file
29
README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Steam-resolve-vanity
|
||||
|
||||
Resolve steam vanity urls
|
||||
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
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(())
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue