Crate trackermeta[][src]

Expand description

This is a simple library and a small utility crate that helps with parsing data from the website called Modarchive, the utility searches modarchive for the filename provided, gets the most likely result, extracts module id and then gets the full details for it as a single csv record which the structure of it can be seen in the docs of the first function of the scraper::requests module or alternatively as a scraper::ModInfo struct using the function scraper::requests::get_full_details_as_struct.

Example: Get module info as a struct using a module id

use trackermeta::scraper::requests;

fn main() {
    let modinfo = requests::get_full_details_as_struct(51772);
    println!("{:#?}", modinfo);
}

Example: Resolve filename to id then use id to get the info as struct

use trackermeta::scraper::{requests, resolver};

fn main() {
    let modid = resolver::resolve_mod_filename("noway.s3m").unwrap();
    let modinfo = requests::get_full_details_as_struct(modid);
    println!("{:#?}", modinfo);
}

Example: Resolve filename to id then use id to get the info as string

use trackermeta::scraper::{requests, resolver};

fn main() {
    let modid = resolver::resolve_mod_filename("noway.s3m").unwrap();
    let modinfo = requests::get_full_details_as_string(modid);
    println!("{}", modinfo);
}

There are more examples other than these which showcase more, remember to check the examples directory!

Modules

The main module containing everything in the crate