#metadata #tracker #html-parser #modarchive

trackermeta

Simple library to get and parse modarchive module data

16 releases

0.5.1 Mar 25, 2023
0.5.0 Mar 3, 2022
0.4.3 Nov 29, 2021
0.3.1 Jul 24, 2021

#22 in #tracker

MPL-2.0 license

16KB
333 lines

Trackermeta

This is a simple library crate that helps with parsing data from the website called Modarchive, it recently had a big reborn update (v0.5.0) it's now far more reliable, and parses the html very nicely, the code is readable and easier to use, the documentation is also superior, if you've used this library in the past please upgrade!

Examples

Check out the examples/ directory on the github repo for all examples using the library

Features

Simplicity

One of the features is how simple using the library is, there is one struct, ModInfo, and two functions on top of that, get() and resolve_filename(), they get a module by their id or search for a string, respectively.

(please check documentation for more info)

Infinity retry

This feature basically enables you to make the library retry infinitely (http requests) regardless of errors until Modarchive gives in


lib.rs:

This is a library crate for working with the Modarchive website, it is very barebones and simple to work with, please check out the documentation for ModInfo and its methods for more info, do be sure to look at the examples aswell!

(This is the Reborn update, v0.5.x)

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

use trackermeta::ModInfo;

fn main() {
    let modinfo = ModInfo::get(51772).unwrap();
    println!("{:#?}", modinfo);
}

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

use trackermeta::ModInfo;

fn main() {
    let modid = ModInfo::resolve_filename("noway.s3m").unwrap()[0].id;
    let modinfo = ModInfo::get(modid).unwrap();
    println!("{:#?}", modinfo);
}

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

Dependencies

~4MB
~106K SLoC