CLI app in pure safe Rust that converts a requested Steam Kazakhstan balance amount (KZT) into the RUB amount you need to pay a ggsel seller via SBP.
The app reads the current ggsel course from:
- product page (default):
https://ggsel.net/catalog/product/avtopopolnenie-steam-kazaxstan-tenge-kzt-4841114 - fallback main page:
https://ggsel.net/
- Pure Rust codebase (
#![forbid(unsafe_code)]) - Zero Rust dependencies (
stdonly) - Runtime logging (
--verbose) - Structured error messages
- Automatic fallback from product page to main page when parser fails
- Offline mode for deterministic tests via
--html-file
- Rust toolchain (
cargo,rustc) curlinPATH(used to fetch HTTPS ggsel pages)
cargo build --release# Live fetch from ggsel product page (with fallback to main page)
cargo run -- 1000
# Verbose logs
cargo run -- --verbose 1500
# Custom URLs
cargo run -- --url "https://ggsel.net/catalog/product/avtopopolnenie-steam-kazaxstan-tenge-kzt-4841114" --main-url "https://ggsel.net/" 2000
# Offline/fixture mode (no network)
cargo run -- --html-file tests/fixtures/product_page_sample.html 1000Example output:
KZT requested: 1000.00
Detected rate: 1 KZT = 0.187000 RUB
RUB to pay via SBP: 187.00
--url <URL> Primary ggsel URL
--main-url <URL> Fallback ggsel URL
--timeout <SECONDS> curl timeout in seconds
--html-file <PATH> Read HTML from local file instead of network
--no-fallback Do not fetch fallback URL if parser fails
-v, --verbose Enable debug logs
-h, --help Show help
cargo testTests include:
- unit tests for argument parsing
- unit tests for course extraction/parsing
- unit tests for conversion/rounding
- integration CLI tests with fixture HTML
- The converter rounds up to the nearest kopeck (
0.01 RUB) to avoid underpaying. - ggsel markup can change; if parsing fails, update the parser heuristics in
src/parse.rs.