A very simple HTML scraper for https://www.metacritic.com/ made in Rust. Unfortunately metacritic has no API, so this is the only way to make a CLI app to search scores of games, movies etc.
You can provide title as an argument and get score and basic info about platform and release date or you can provide "coming-soon" to get upcoming releases. The options should work the same way in both use cases.
I'm a gamer so the default type is game, but there is a "-t" option to change that.
rustc 1.68.0
cargo 1.68.0
clap = { version = "4.0.25", features = ["derive"] }
colored = "2.0.0"
reqwest = {version = "0.11", features = ["blocking"]}
scraper = "0.12.0"
serde_derive = "1.0.158"
serde_json = "1.0.89"
urlencoding = "2.1.2"
For testing purposes:
bash
git clone https://github.com/Nithe14/metacritic-cli.git
cd metacritic-cli
cargo run -- -h
Install it as a binary:
```bash git clone https://github.com/Nithe14/metacritic-cli.git cd metacritic-cli cargo install --path .
export PATH=~/.cargo/bin:$PATH metacritic-cli -h ``` How to use:
```bash $ metacritic-cli -h
Usage: metacritic-cli [OPTIONS]
Arguments:
metacritic-cli "witcher 3"
metacritic-cli coming-soon -p ps5
Options:
-s, --single
Print only the first object from the result page.
Works as -n 1.
-j, --json
Print output as json
-n, --number-of-results