-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
77 lines (60 loc) · 1.58 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const axios = require("axios");
class OverwatchLeague {
constructor(locale = "en_US") {
this.axios = axios.create({
baseURL: "https://api.overwatchleague.com/",
params: {
locale
}
});
}
getAppData() {
return this.axios.get("about");
};
getSchedule() {
return this.axios.get("schedule");
};
getLiveStreams() {
return this.axios.get("streams");
};
getMatch(id) {
return this.axios.get(`match/${id}`);
};
getTeam(id) {
return this.axios.get(`team/${id}`);
};
getTeams() {
return this.axios.get(`teams?expand=team.content&locale=en_US`);
};
getNews() {
return this.axios.get("news");
};
getPlaylistVideos(name) { // todo: are we the app?
return this.axios.get(`playlist/${name}`);
};
getRankings() {
return this.axios.get("ranking");
};
getStandings() {
return this.axios.get("standings");
};
getVideos() {
return this.axios.get("vods");
};
getMatchStats(matchId, mapNumber) {
return this.axios.get(`stats/matches/${matchId}/maps/${mapNumber}`);
};
getPlayers() {
return this.axios.get("stats/players");
};
getPlayer(id) {
return this.axios.get(`players/${id}?expand=stats,stats.ranks`);
};
getUpcomingLiveMatches() {
return this.axios.get("live-match?expand=team.content&locale=en-us");
};
getMaps() {
return this.axios.get("maps");
};
}
module.exports = OverwatchLeague;