gj-boomlings-api 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ # Level object
2
+
3
+ Used by ```getProfile()```.
4
+
5
+ ## Example
6
+ ```
7
+ {
8
+ username: 'RobTop',
9
+ playerID: 16,
10
+ accountID: 71,
11
+ rank: 219796,
12
+ stars: 2375,
13
+ diamonds: 2170,
14
+ secretCoins: 3,
15
+ userCoins: 140,
16
+ demons: 5,
17
+ creatorPoints: 0,
18
+ messages: 'none',
19
+ friendRequests: 'none',
20
+ commentHistory: 'all',
21
+ mod: 'elder',
22
+ youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw',
23
+ twitter: 'https://twitter.com/RobTopGames',
24
+ twitch: 'https://twitch.tv/robtopgames'
25
+ }
26
+ ```
27
+
28
+ ## Properties
29
+ ```username``` - the player's username.
30
+ ```playerID``` - the player ID.
31
+ ```accountID``` - the account ID.
32
+ ```rank``` - the user's position in the global leaderboard. Returns `0` if the player hasn't received it yet or if the player is banned on the leaderboard.
33
+ ```stars``` - the amount of stars the player has.
34
+ ```diamonds``` - the amount of diamonds the player has.
35
+ ```secretCoins``` - the amount of secret (gold) coins the player has collected.
36
+ ```userCoins``` - the amount of user (white) coins the player has collected.
37
+ ```demons``` - the amount of demons the player has beaten.
38
+ ```creatorPoints``` - the amount of creator points the player has.
39
+ ```messages``` - a property that shows if you can send messages to the player. Returns `"none"` if the DMs are closed, `"friends"` if sending DMs is available to only friends, and `"all"` if everyone can send messages to the specified player.
40
+ ```friendRequests``` - a property that shows if you can send friend requests to the player. Returns `"none"` if you can't or `"all"` if everyone can send friend requests to the specified player.
41
+ ```commentHistory``` - a property that shows if you can view the player's comment history. Returns `"none"` if you can't, `"friends"` if viewing the comment history is available to only friends, and `"all"` if everyone can view the comment history.
42
+ ```mod``` - a property that shows if the player is an in-game moderator. Returns `"none"` if not, `"mod"` if the player is a regular Mod (yellow badge), and `"elder"` if the player is an Elder Mod (orange badge).
43
+ ```youtube``` - the link to the player's YouTube channel.
44
+ ```twitter``` - the link to the player's Twitter account.
45
+ ```twitch``` - the link to the player's Twitch channel.
@@ -0,0 +1,19 @@
1
+ # reportLevel()
2
+
3
+ Reports the level.
4
+
5
+ ## Parameters
6
+ `level` - the level id.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.reportLevel(54953085).then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```js
16
+ 1
17
+ ```
18
+
19
+ For some reason, the API always returns 1, even if you'll provide an invalid ID.
@@ -2,7 +2,7 @@ module.exports = {
2
2
  decURLSafeBase64:
3
3
  function(string) {
4
4
  const bs = require("js-base64");
5
- if(!string) throw new Error("No string provided!")
5
+ if(!string || string == "") throw new Error("No string provided!")
6
6
  let str = bs.decode(string.replace(/_/g, '/').replace(/-/g, '+'));
7
7
  if(!bs.isValid(str)) throw new Error("The provided string is not encoded in Base64!")
8
8
  return str;
@@ -2,10 +2,10 @@ module.exports = {
2
2
  dlLevel:
3
3
  async function(level) {
4
4
  const bs = require("js-base64")
5
- if(!level) throw new Error("Please provide a level ID.");
5
+ if(!level || level == "") throw new Error("Please provide a level ID.");
6
6
  if(isNaN(level)) throw new Error("The level parameter should be a number.");
7
7
  const axios = require("axios");
8
- const { headers } = require("../config.json");
8
+ const { headers, server } = require("../config.json");
9
9
 
10
10
  const XOR = require("../misc/xor.js");
11
11
  let xor = new XOR()
@@ -14,11 +14,11 @@ module.exports = {
14
14
  gameVersion: 21,
15
15
  binaryVersion: 35,
16
16
  gdw: 0,
17
- levelID: level.trim(),
17
+ levelID: level.toString().trim(),
18
18
  secret: "Wmfd2893gb7"
19
19
  }
20
20
 
21
- let res = await axios.post('http://www.boomlings.com/database/downloadGJLevel22.php', data, {
21
+ let res = await axios.post(server + 'downloadGJLevel22.php', data, {
22
22
  headers: headers
23
23
  })
24
24
 
@@ -126,7 +126,7 @@ module.exports = {
126
126
  str: split23.split(":8:")[0],
127
127
  secret: "Wmfd2893gb7"
128
128
  }
129
- let auth = await axios.post("http://www.boomlings.com/database/getGJUsers20.php", authData, {
129
+ let auth = await axios.post(server + "getGJUsers20.php", authData, {
130
130
  headers: headers
131
131
  })
132
132
  let authname;
@@ -169,7 +169,7 @@ module.exports = {
169
169
  try {
170
170
  song = await getSongInfo(split26.split(":36:")[0]);
171
171
  } catch(err) {
172
- let songReq = await axios.post('http://www.boomlings.com/database/getGJLevels21.php', {
172
+ let songReq = await axios.post(server + 'getGJLevels21.php', {
173
173
  gameVersion: 21,
174
174
  binaryVersion: 35,
175
175
  gdw: 0,
@@ -208,7 +208,7 @@ module.exports = {
208
208
  const result = {
209
209
  "id": Number(split1.split(":2:")[0]),
210
210
  "name": split2.split(":3:")[0].toString(),
211
- "description": desc,
211
+ "description": desc.trim(),
212
212
  "creator": authname,
213
213
  "level_version": Number(split4.split(":6:")[0]),
214
214
  "difficulty": difficultyDecoding[split5.split(":10:")[0]].toString(),
@@ -2,8 +2,8 @@ module.exports = {
2
2
  encURLSafeBase64:
3
3
  function(string) {
4
4
  const bs = require("js-base64");
5
- if(!string) throw new Error("No string provided!")
6
- let str = bs.encode(string).replace('/', /_/g).replace('+', /-/g);
5
+ if(!string || string == "") throw new Error("No string provided!")
6
+ let str = bs.encode(string, true);
7
7
  return str;
8
8
  }
9
9
  }
@@ -0,0 +1,146 @@
1
+ module.exports = {
2
+ getCommentHistory:
3
+ async function(str, page = 1, mode = 1) {
4
+ if(!str || str == "") throw new Error("Please provide a player ID or name!");
5
+ const axios = require("axios");
6
+ const {headers, server} = require("../config.json");
7
+ const {decCommentFromHistory} = require("../misc/decCommentFromHistory.js");
8
+ const {getProfile} = require("./getProfile.js");
9
+
10
+ const userData = {
11
+ gameVersion: 21,
12
+ binaryVersion: 35,
13
+ gdw: 0,
14
+ str: str,
15
+ secret: "Wmfd2893gb7"
16
+ }
17
+
18
+ let r = await axios.post(server + "getGJUsers20.php", userData, {
19
+ headers: headers
20
+ })
21
+
22
+ let id = r.data.split(":2:")[1].split(":13:")[0];
23
+
24
+ const user = await getProfile(id);
25
+ if(user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!")
26
+
27
+ const CHData = {
28
+ gameVersion: 21,
29
+ binaryVersion: 35,
30
+ gdw: 0,
31
+ secret: "Wmfd2893gb7",
32
+ userID: id,
33
+ page: page - 1,
34
+ mode: 1
35
+ }
36
+
37
+ let res = await axios.post(server + "getGJCommentHistory.php", CHData, {
38
+ headers: headers
39
+ })
40
+
41
+ let firstComment = res.data;
42
+ let secondComment;
43
+ let thirdComment;
44
+ let fourthComment;
45
+ let fifthComment;
46
+ let sixthComment;
47
+ let seventhComment;
48
+ let eighthComment;
49
+ let ninthComment;
50
+ let tenthComment;
51
+
52
+ let result = [decCommentFromHistory(firstComment)]
53
+
54
+ if(res.data.split("|").length - 1 == 1) {
55
+ firstComment = res.data.split("|")[0];
56
+ secondComment = res.data.split("|")[1].split("|")[0];
57
+ result.push(decCommentFromHistory(secondComment))
58
+ }
59
+
60
+ if(res.data.split("|").length - 1 == 2) {
61
+ firstComment = res.data.split("|")[0];
62
+ secondComment = res.data.split("|")[1].split("|")[0];
63
+ thirdComment = res.data.split("|")[2].split("|")[0];
64
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment))
65
+ }
66
+
67
+ if(res.data.split("|").length - 1 == 3) {
68
+ firstComment = res.data.split("|")[0];
69
+ secondComment = res.data.split("|")[1].split("|")[0];
70
+ thirdComment = res.data.split("|")[2].split("|")[0];
71
+ fourthComment = res.data.split("|")[3].split("|")[0];
72
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment))
73
+ }
74
+
75
+ if(res.data.split("|").length - 1 == 4) {
76
+ firstComment = res.data.split("|")[0];
77
+ secondComment = res.data.split("|")[1].split("|")[0];
78
+ thirdComment = res.data.split("|")[2].split("|")[0];
79
+ fourthComment = res.data.split("|")[3].split("|")[0];
80
+ fifthComment = res.data.split("|")[4].split("|")[0];
81
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment))
82
+ }
83
+
84
+ if(res.data.split("|").length - 1 == 5) {
85
+ firstComment = res.data.split("|")[0];
86
+ secondComment = res.data.split("|")[1].split("|")[0];
87
+ thirdComment = res.data.split("|")[2].split("|")[0];
88
+ fourthComment = res.data.split("|")[3].split("|")[0];
89
+ fifthComment = res.data.split("|")[4].split("|")[0];
90
+ sixthComment = res.data.split("|")[5].split("|")[0];
91
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment))
92
+ }
93
+
94
+ if(res.data.split("|").length - 1 == 6) {
95
+ firstComment = res.data.split("|")[0];
96
+ secondComment = res.data.split("|")[1].split("|")[0];
97
+ thirdComment = res.data.split("|")[2].split("|")[0];
98
+ fourthComment = res.data.split("|")[3].split("|")[0];
99
+ fifthComment = res.data.split("|")[4].split("|")[0];
100
+ sixthComment = res.data.split("|")[5].split("|")[0];
101
+ seventhComment = res.data.split("|")[6].split("|")[0];
102
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment))
103
+ }
104
+
105
+ if(res.data.split("|").length - 1 == 7) {
106
+ firstComment = res.data.split("|")[0];
107
+ secondComment = res.data.split("|")[1].split("|")[0];
108
+ thirdComment = res.data.split("|")[2].split("|")[0];
109
+ fourthComment = res.data.split("|")[3].split("|")[0];
110
+ fifthComment = res.data.split("|")[4].split("|")[0];
111
+ sixthComment = res.data.split("|")[5].split("|")[0];
112
+ seventhComment = res.data.split("|")[6].split("|")[0];
113
+ eighthComment = res.data.split("|")[7].split("|")[0];
114
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment))
115
+ }
116
+
117
+ if(res.data.split("|").length - 1 == 8) {
118
+ firstComment = res.data.split("|")[0];
119
+ secondComment = res.data.split("|")[1].split("|")[0];
120
+ thirdComment = res.data.split("|")[2].split("|")[0];
121
+ fourthComment = res.data.split("|")[3].split("|")[0];
122
+ fifthComment = res.data.split("|")[4].split("|")[0];
123
+ sixthComment = res.data.split("|")[5].split("|")[0];
124
+ seventhComment = res.data.split("|")[6].split("|")[0];
125
+ eighthComment = res.data.split("|")[7].split("|")[0];
126
+ ninthComment = res.data.split("|")[8].split("|")[0];
127
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment),decCommentFromHistory(ninthComment))
128
+ }
129
+
130
+ if(res.data.split("|").length - 1 == 9) {
131
+ firstComment = res.data.split("|")[0];
132
+ secondComment = res.data.split("|")[1].split("|")[0];
133
+ thirdComment = res.data.split("|")[2].split("|")[0];
134
+ fourthComment = res.data.split("|")[3].split("|")[0];
135
+ fifthComment = res.data.split("|")[4].split("|")[0];
136
+ sixthComment = res.data.split("|")[5].split("|")[0];
137
+ seventhComment = res.data.split("|")[6].split("|")[0];
138
+ eighthComment = res.data.split("|")[7].split("|")[0];
139
+ ninthComment = res.data.split("|")[8].split("|")[0];
140
+ tenthComment = res.data.split("|")[9].split("|")[0];
141
+ result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment),decCommentFromHistory(ninthComment),decCommentFromHistory(tenthComment))
142
+ }
143
+
144
+ return result;
145
+ }
146
+ }
@@ -1,8 +1,10 @@
1
1
  module.exports = {
2
2
  getComments:
3
3
  async function(level, page = 1, mode = 1) {
4
+ if(!level || level == "") throw new Error("Please provide a level ID!");
5
+ if(isNaN(level)) throw new Error("A level ID should be a number.");
4
6
  const axios = require("axios");
5
- const {headers} = require("../config.json");
7
+ const {headers, server} = require("../config.json");
6
8
  const { decodeGJComment } = require("../misc/decodeGJComment.js");
7
9
 
8
10
  const data = {
@@ -15,22 +17,112 @@ module.exports = {
15
17
  gdw: 0
16
18
  }
17
19
 
18
- let res = await axios.post("http://www.boomlings.com/database/getGJComments21.php", data, {
20
+ let res = await axios.post(server + "getGJComments21.php", data, {
19
21
  headers: headers
20
22
  })
21
23
 
22
- const firstComment = res.data.split("|")[0];
23
- const secondComment = res.data.split("|")[1].split("|")[0];
24
- const thirdComment = res.data.split("|")[2].split("|")[0];
25
- const fourthComment = res.data.split("|")[3].split("|")[0];
26
- const fifthComment = res.data.split("|")[4].split("|")[0];
27
- const sixthComment = res.data.split("|")[5].split("|")[0];
28
- const seventhComment = res.data.split("|")[6].split("|")[0];
29
- const eighthComment = res.data.split("|")[7].split("|")[0];
30
- const ninthComment = res.data.split("|")[8].split("|")[0];
31
- const tenthComment = res.data.split("|")[9].split("|")[0];
32
-
33
- const result = [decodeGJComment(firstComment),decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment),decodeGJComment(seventhComment),decodeGJComment(eighthComment),decodeGJComment(ninthComment),decodeGJComment(tenthComment)]
24
+ let firstComment = res.data;
25
+ let secondComment;
26
+ let thirdComment;
27
+ let fourthComment;
28
+ let fifthComment;
29
+ let sixthComment;
30
+ let seventhComment;
31
+ let eighthComment;
32
+ let ninthComment;
33
+ let tenthComment;
34
+
35
+ let result = [decodeGJComment(firstComment)]
36
+
37
+ if(res.data.split("|").length - 1 == 1) {
38
+ firstComment = res.data.split("|")[0];
39
+ secondComment = res.data.split("|")[1].split("|")[0];
40
+ result.push(decodeGJComment(secondComment))
41
+ }
42
+
43
+ if(res.data.split("|").length - 1 == 2) {
44
+ firstComment = res.data.split("|")[0];
45
+ secondComment = res.data.split("|")[1].split("|")[0];
46
+ thirdComment = res.data.split("|")[2].split("|")[0];
47
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment))
48
+ }
49
+
50
+ if(res.data.split("|").length - 1 == 3) {
51
+ firstComment = res.data.split("|")[0];
52
+ secondComment = res.data.split("|")[1].split("|")[0];
53
+ thirdComment = res.data.split("|")[2].split("|")[0];
54
+ fourthComment = res.data.split("|")[3].split("|")[0];
55
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment))
56
+ }
57
+
58
+ if(res.data.split("|").length - 1 == 4) {
59
+ firstComment = res.data.split("|")[0];
60
+ secondComment = res.data.split("|")[1].split("|")[0];
61
+ thirdComment = res.data.split("|")[2].split("|")[0];
62
+ fourthComment = res.data.split("|")[3].split("|")[0];
63
+ fifthComment = res.data.split("|")[4].split("|")[0];
64
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment))
65
+ }
66
+
67
+ if(res.data.split("|").length - 1 == 5) {
68
+ firstComment = res.data.split("|")[0];
69
+ secondComment = res.data.split("|")[1].split("|")[0];
70
+ thirdComment = res.data.split("|")[2].split("|")[0];
71
+ fourthComment = res.data.split("|")[3].split("|")[0];
72
+ fifthComment = res.data.split("|")[4].split("|")[0];
73
+ sixthComment = res.data.split("|")[5].split("|")[0];
74
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment))
75
+ }
76
+
77
+ if(res.data.split("|").length - 1 == 6) {
78
+ firstComment = res.data.split("|")[0];
79
+ secondComment = res.data.split("|")[1].split("|")[0];
80
+ thirdComment = res.data.split("|")[2].split("|")[0];
81
+ fourthComment = res.data.split("|")[3].split("|")[0];
82
+ fifthComment = res.data.split("|")[4].split("|")[0];
83
+ sixthComment = res.data.split("|")[5].split("|")[0];
84
+ seventhComment = res.data.split("|")[6].split("|")[0];
85
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment),decodeGJComment(seventhComment))
86
+ }
87
+
88
+ if(res.data.split("|").length - 1 == 7) {
89
+ firstComment = res.data.split("|")[0];
90
+ secondComment = res.data.split("|")[1].split("|")[0];
91
+ thirdComment = res.data.split("|")[2].split("|")[0];
92
+ fourthComment = res.data.split("|")[3].split("|")[0];
93
+ fifthComment = res.data.split("|")[4].split("|")[0];
94
+ sixthComment = res.data.split("|")[5].split("|")[0];
95
+ seventhComment = res.data.split("|")[6].split("|")[0];
96
+ eighthComment = res.data.split("|")[7].split("|")[0];
97
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment),decodeGJComment(seventhComment),decodeGJComment(eighthComment))
98
+ }
99
+
100
+ if(res.data.split("|").length - 1 == 8) {
101
+ firstComment = res.data.split("|")[0];
102
+ secondComment = res.data.split("|")[1].split("|")[0];
103
+ thirdComment = res.data.split("|")[2].split("|")[0];
104
+ fourthComment = res.data.split("|")[3].split("|")[0];
105
+ fifthComment = res.data.split("|")[4].split("|")[0];
106
+ sixthComment = res.data.split("|")[5].split("|")[0];
107
+ seventhComment = res.data.split("|")[6].split("|")[0];
108
+ eighthComment = res.data.split("|")[7].split("|")[0];
109
+ ninthComment = res.data.split("|")[8].split("|")[0];
110
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment),decodeGJComment(seventhComment),decodeGJComment(eighthComment),decodeGJComment(ninthComment))
111
+ }
112
+
113
+ if(res.data.split("|").length - 1 == 9) {
114
+ firstComment = res.data.split("|")[0];
115
+ secondComment = res.data.split("|")[1].split("|")[0];
116
+ thirdComment = res.data.split("|")[2].split("|")[0];
117
+ fourthComment = res.data.split("|")[3].split("|")[0];
118
+ fifthComment = res.data.split("|")[4].split("|")[0];
119
+ sixthComment = res.data.split("|")[5].split("|")[0];
120
+ seventhComment = res.data.split("|")[6].split("|")[0];
121
+ eighthComment = res.data.split("|")[7].split("|")[0];
122
+ ninthComment = res.data.split("|")[8].split("|")[0];
123
+ tenthComment = res.data.split("|")[9].split("|")[0];
124
+ result.push(decodeGJComment(secondComment),decodeGJComment(thirdComment),decodeGJComment(fourthComment),decodeGJComment(fifthComment),decodeGJComment(sixthComment),decodeGJComment(seventhComment),decodeGJComment(eighthComment),decodeGJComment(ninthComment),decodeGJComment(tenthComment))
125
+ }
34
126
 
35
127
  return result;
36
128
  }
@@ -0,0 +1,55 @@
1
+ module.exports = {
2
+ getGauntlets:
3
+ async function() {
4
+ const axios = require('axios');
5
+ const {headers, server} = require("../config.json");
6
+ const { decodeGJGauntlet } = require("../misc/decodeGJGauntlet.js")
7
+
8
+ const data = {
9
+ secret: "Wmfd2893gb7",
10
+ gameVersion: 21,
11
+ binaryVersion: 35,
12
+ gdw: 0
13
+ }
14
+
15
+ let res = await axios.post(server + "getGJGauntlets21.php", data, {
16
+ headers: headers
17
+ })
18
+
19
+ let first = res.data.split("|")[0];
20
+ let second = res.data.split("|")[1].split("|")[0];
21
+ let third = res.data.split("|")[2].split("|")[0];
22
+ let fourth = res.data.split("|")[3].split("|")[0];
23
+ let fifth = res.data.split("|")[4].split("|")[0];
24
+ let sixth = res.data.split("|")[5].split("|")[0];
25
+ let seventh = res.data.split("|")[6].split("|")[0];
26
+ let eighth = res.data.split("|")[7].split("|")[0];
27
+ let ninth = res.data.split("|")[8].split("|")[0];
28
+ let tenth = res.data.split("|")[9].split("|")[0];
29
+ let eleventh = res.data.split("|")[10].split("|")[0];
30
+ let twelfth = res.data.split("|")[11].split("|")[0];
31
+ let thirteenth = res.data.split("|")[12].split("|")[0];
32
+ let fourteenth = res.data.split("|")[13].split("|")[0];
33
+ let fifteenth = res.data.split("|")[14].split("|")[0];
34
+
35
+ const result = [
36
+ decodeGJGauntlet(first),
37
+ decodeGJGauntlet(second),
38
+ decodeGJGauntlet(third),
39
+ decodeGJGauntlet(fourth),
40
+ decodeGJGauntlet(fifth),
41
+ decodeGJGauntlet(sixth),
42
+ decodeGJGauntlet(seventh),
43
+ decodeGJGauntlet(eighth),
44
+ decodeGJGauntlet(ninth),
45
+ decodeGJGauntlet(tenth),
46
+ decodeGJGauntlet(eleventh),
47
+ decodeGJGauntlet(twelfth),
48
+ decodeGJGauntlet(thirteenth),
49
+ decodeGJGauntlet(fourteenth),
50
+ decodeGJGauntlet(fifteenth),
51
+ ]
52
+
53
+ return result;
54
+ }
55
+ }
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  getOfficialSongInfo:
3
3
  function(song) {
4
- if(!song) throw new Error("Please provide a song ID.");
4
+ if(!song || song == "") throw new Error("Please provide a song ID.");
5
5
  if(isNaN(song)) throw new Error("A song ID must be a number.");
6
6
  const {
7
7
  sm,
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
2
  getProfile:
3
3
  async function(str) {
4
- if(!str) throw new Error("Please provide a user ID or name!");
4
+ if(!str || str == "") throw new Error("Please provide a user ID or name!");
5
5
  const axios = require("axios");
6
- const { headers } = require("../config.json");
6
+ const { headers, server } = require("../config.json");
7
7
 
8
8
  const data = {
9
9
  gameVersion: 21,
@@ -13,7 +13,7 @@ module.exports = {
13
13
  secret: "Wmfd2893gb7"
14
14
  };
15
15
 
16
- let r = await axios.post("http://www.boomlings.com/database/getGJUsers20.php", data, {
16
+ let r = await axios.post(server + "getGJUsers20.php", data, {
17
17
  headers: headers
18
18
  })
19
19
 
@@ -28,7 +28,7 @@ module.exports = {
28
28
  secret: "Wmfd2893gb7"
29
29
  };
30
30
 
31
- let res = await axios.post("http://www.boomlings.com/database/getGJUserInfo20.php", GJUI20data, {
31
+ let res = await axios.post(server + "getGJUserInfo20.php", GJUI20data, {
32
32
  headers: headers
33
33
  })
34
34
 
@@ -1,17 +1,17 @@
1
1
  module.exports = {
2
2
  getSongInfo:
3
3
  async function(song) {
4
- if(!song) throw new Error("Please provide a song ID.");
4
+ if(!song || song == "") throw new Error("Please provide a song ID.");
5
5
  if(isNaN(song)) throw new Error("A song ID must be a number.")
6
6
  const axios = require("axios")
7
- const {headers} = require("../config.json")
7
+ const {headers, server} = require("../config.json")
8
8
 
9
9
  const data = {
10
10
  songID: song,
11
11
  secret: "Wmfd2893gb7"
12
12
  }
13
13
 
14
- let res = await axios.post('http://www.boomlings.com/database/getGJSongInfo.php', data, {
14
+ let res = await axios.post(server + 'getGJSongInfo.php', data, {
15
15
  headers: headers
16
16
  })
17
17
 
@@ -1,18 +1,18 @@
1
1
  module.exports = {
2
2
  reportLevel:
3
3
  async function(level) {
4
- if(!level) throw new Error("Please provide a level ID.");
4
+ if(!level || level == "") throw new Error("Please provide a level ID.");
5
5
  if(isNaN(Number(level))) throw new Error("The level ID should be a number.");
6
6
 
7
7
  const axios = require("axios")
8
- const {headers} = require("../config.json");
8
+ const {headers, server} = require("../config.json");
9
9
 
10
10
  const data = {
11
- levelID: Number(level),
11
+ levelID: level.toString().trim(),
12
12
  secret: "Wmfd2893gb7"
13
13
  }
14
14
 
15
- let res = await axios.post("http://www.boomlings.com/database/reportGJLevel.php", data, {
15
+ let res = await axios.post(server + "reportGJLevel.php", data, {
16
16
  headers: headers
17
17
  })
18
18
 
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const { dlLevel } = require("./functions/dlLevel.js");
2
- const { getLevelData } = require("./functions/getLevelData.js");
3
2
  const { getSongInfo } = require("./functions/getSongInfo.js");
4
3
  const { getOfficialSongInfo } = require("./functions/getOfficialSongInfo.js");
5
4
  const { decURLSafeBase64 } = require("./functions/decURLSafeBase64.js");
@@ -9,9 +8,10 @@ const { getWeeklyDemon } = require("./functions/getWeeklyDemon.js");
9
8
  const { getProfile } = require("./functions/getProfile.js");
10
9
  const { reportLevel } = require("./functions/reportLevel.js");
11
10
  const { getComments } = require("./functions/getComments.js");
11
+ const { getCommentHistory } = require("./functions/getCommentHistory.js");
12
+ const { getGauntlets } = require("./functions/getGauntlets.js");
12
13
 
13
14
  module.exports.dlLevel = dlLevel;
14
- module.exports.getLevelData = getLevelData;
15
15
  module.exports.getSongInfo = getSongInfo;
16
16
  module.exports.getOfficialSongInfo = getOfficialSongInfo;
17
17
  module.exports.decURLSafeBase64 = decURLSafeBase64;
@@ -20,4 +20,6 @@ module.exports.getDailyLevel = getDailyLevel;
20
20
  module.exports.getWeeklyDemon = getWeeklyDemon;
21
21
  module.exports.getProfile = getProfile;
22
22
  module.exports.reportLevel = reportLevel;
23
- module.exports.getComments = getComments;
23
+ module.exports.getComments = getComments;
24
+ module.exports.getCommentHistory = getCommentHistory;
25
+ module.exports.getGauntlets = getGauntlets;
@@ -0,0 +1,31 @@
1
+ module.exports = {
2
+ decCommentFromHistory:
3
+ function(comment) {
4
+ const bs = require("js-base64");
5
+
6
+ let levelID = comment.split("~1~")[1].split("~3~")[0];
7
+ let commentContent = comment.split("2~")[1].split("~1~")[0];
8
+ let playerID = comment.split("~3~")[1].split("~4~")[0];
9
+ let likes = comment.split("~4~")[1].split("~10~")[0];
10
+ let percent = comment.split("~10~")[1].split("~9~")[0];
11
+ let age = comment.split("~9~")[1].split("~6~")[0];
12
+ let messageID = comment.split("~6~")[1].split(":1~")[0];
13
+ let username = comment.split(":1~")[1].split("~9~")[0];
14
+
15
+ if(messageID.includes("~")) messageID = comment.split("~6~")[1].split("~11~")[0];
16
+ if(playerID.includes("~")) playerID = comment.split("~3~")[1].split("~4~")[0].split("~")[0];
17
+
18
+ const res = {
19
+ username: username,
20
+ content: bs.decode(commentContent.replace(/_/g, '/').replace(/-/g, '+')),
21
+ levelID: Number(levelID),
22
+ playerID: Number(playerID),
23
+ likes: Number(likes),
24
+ percent: Number(percent),
25
+ id: Number(messageID),
26
+ age: age
27
+ }
28
+
29
+ return res;
30
+ }
31
+ }