roccodev_api/monthlies/
mod.rs1use super::http;
2use {Profile, Leaderboard};
3
4pub fn leaderboard(mode: &str, start: Option<usize>, end: Option<usize>) -> Leaderboard {
5
6 let url;
7 match start {
8 None => url = format!("https://api.roccodev.pw/{}/monthlies/leaderboard/", mode),
9 Some(ref start) => url = format!("https://api.roccodev.pw/{}/monthlies/leaderboard?from={}&to={}", mode, start, end.unwrap_or(500)),
10 }
11 let json = http::json_from_url(url);
12 return json;
13
14}
15
16pub fn profile(mode: &str, uuid: &str) -> Profile {
17 let url = format!("https://api.roccodev.pw/{}/monthlies/profile/{}", mode, uuid);
18 let json = http::json_from_url(url);
19 return json;
20}
21