anitrendz-cli icon indicating copy to clipboard operation
anitrendz-cli copied to clipboard

CLI version of anitrendz.net that scrapes the site and displays anime charts, music charts....

anitrendz-cli

Note

Rewrote this cli app since the anitiop api api broke. The code for the previous app can be found under the v1-anitop branch.

project setup

Download the binary package from the releases page. As mentioned v1 ued the anitop api and since it isn't online using it won't work. To use the new version, clone the repo and cargo run the project.

Description

Anitrendz is a cli app that uses data scraped from the anitrendz website to list the top anime, ships, characters and songs.

I made this project to strengthen my knowledge on rust and learn how to handle JSON data but anc continually improve on it.

I am in the process of writing an article on how to scrape websites with Rust and will publish it very soon

Tech stack 💻

This is a rust project and I am using the following crates.

  • clap for parsing command line arguments.
  • serde for serializing and deserializing the JSON data.
  • reqwest for making HTTP requests to the anitop api.
  • select for scraping the anitrendz website.

Source data 📝

For the data, i used the anitrendz.net website

What I learned?

  • fetching data using reqwest and consuming api's in rust.
  • using serde.js to deserialize and serialize json data.
  • How to format custom types and display them using Display.
  • ANSI escape codes and especially Select Graphics Rendition(SGR) for the colored output
  • making a command line app using clap.rs

Project setup

Download the binary package from the releases page.

Jimmy ©2021 - present