5 unstable releases
0.3.0 | Mar 24, 2023 |
---|---|
0.2.0 | Mar 1, 2023 |
0.1.2 | Feb 19, 2023 |
0.1.1 | Feb 17, 2023 |
0.1.0 | Feb 15, 2023 |
#5 in #cover
24 downloads per month
62KB
877 lines
Speedrunapi
*Rust Edition
The speedrunapi crate intends to help make working with speedrun.coms REST API easier.
Currently this project is in its very early stages, with hope to cover everything possible efficently, and easily. Any help on the project is very much appreiciated!
This project was made by me for fun and to help me pratice rust, so I hope someone can find use for this.
NOTE: 0.3.0 is a major rewrite of the project, causing breaking changes to mostly every thing.
Basic Usage:
use speedrunapi::GameData;
let result = GameData::new("Mc").run();
assert_eq!(result.name(), "Minecraft: Java Edition");
This gets the name of a game.
use speedrunapi::UserData;
let result = UserData::new("fishin_rod").run();
assert_eq!(result.id(), "jonryvl8");
This gets the id of a user.
For more information about this crate check out the documentation!
lib.rs
:
Speedrunapi
A REST API wrapper for speedrun.com's API
Speedrunapi aims to make working with speedrun.com's api fast and easy
Speedrunapi provides:
- Pre-formatting of data
- Easy to use structure
- Translations of ids/times (Not really used yet will be used more soon!)
- Error handeling
Current Modules:
User Data
This module provides data about users on speedrun.com.
Users have lots of data points connected to them.
The user data module allows people using the crate to get these data points and use them!
Example:
I am using user: Bobertness as an example here, to show off roles. This is a real user!
use speedrunapi::UserData;
let result = UserData::new("Bobertness").run();
assert_eq!(result.role(), "user");
Guest Data
This module provides data about guests on speedrun.com
Guests are how speedrun.com deals with users who havent made an account / arn't logged on to their account.
Guests only have a name and a link connected to them.
Game Data
This module provides data about games on speedrun.com
Games are places on speedrun.com where users can submit runs for.
Games have many data points connected to them. There are a few more data points that go with a game, but require a new module to be used (in progress).
Example:
This examples shows the fetching of the weblink of a game.
use speedrunapi::GameData;
let result = GameData::new("MC").run();
assert_eq!(result.weblink(), "https://www.speedrun.com/mc");
Game Types
This module provides data on game types.
What is a gametype?
According to speedrun.com: (Game types are classifications for unofficial games, for example ROM Hack, Fangame, Modification etc.)
Game types only have a name, an id, and links attached to them.
Levels
*This crate is licensed under the MIT license
Dependencies
~7–20MB
~272K SLoC