gj-boomlings-api 0.5.0 → 1.0.1

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.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  <a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/v/gj-boomlings-api.svg?maxAge=3600" alt="npm version" /></a>
4
4
  <a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/dt/gj-boomlings-api.svg?maxAge=3600" alt="npm downloads" /></a>
5
5
  <a href="https://snyk.io/test/github/shikoshib/gj-boomlings-api"><img src="https://snyk.io/test/github/shikoshib/gj-boomlings-api/badge.svg" alt="Known Vulnerabilities" /></a>
6
+ <a href="https://packagequality.com/#?package=gj-boomlings-api"><img src="https://packagequality.com/shield/gj-boomlings-api.svg"/></a>
6
7
  </div>
7
8
 
8
9
  This package gets info from RobTop's servers (boomlings.com) and converts it into pure and beautiful JSON.
package/config.json CHANGED
@@ -1 +1,10 @@
1
- {"headers":{"Content-Type":"application/x-www-form-urlencoded","user-agent":"","Accept-Encoding":"*","Accept":"*/*"},"server":"http://www.boomlings.com/database/"}
1
+ {
2
+ "headers": {
3
+ "Content-Type":"application/x-www-form-urlencoded",
4
+ "user-agent":"",
5
+ "Accept-Encoding":"*",
6
+ "Accept":"*/*"
7
+ },
8
+ "server":"http://www.boomlings.com/database/",
9
+ "secret":"Wmfd2893gb7"
10
+ }
@@ -0,0 +1,21 @@
1
+ # blockUser()
2
+
3
+ Blocks the user.
4
+
5
+ ## Parameters
6
+ `target` - the user that is being blocked.
7
+
8
+ `user` - the player ID or the username of the user that blocks.
9
+
10
+ `gjp` - the password of the user that blocks.
11
+
12
+ ## Example
13
+ ```js
14
+ const gd = require("gj-boomlings-api");
15
+ gd.blockUser("colon", "gmdshxdow", "*********").then(console.log);
16
+ ```
17
+
18
+ ## Response
19
+ ```js
20
+ 1
21
+ ```
@@ -0,0 +1,23 @@
1
+ # deleteAccountPost()
2
+
3
+ Posts a comment to a profile.
4
+
5
+ ## Parameters
6
+ `id` - the account post ID. Returned by `getAccountPosts()`.
7
+
8
+ `user` - the username or player ID.
9
+
10
+ `gjp` - the user's password.
11
+
12
+ ## Example
13
+ ```js
14
+ const gd = require("gj-boomlings-api");
15
+ gd.deleteAccountPost("18183557", "gmdshxdow", "*********").then(console.log);
16
+ ```
17
+
18
+ ## Response
19
+ ```js
20
+ 1
21
+ ```
22
+
23
+ Returns `1` if the comment was successfully deleted.
@@ -0,0 +1,60 @@
1
+ # getCreatorScores()
2
+
3
+ Gets the top 100 creators leaderboard, sorted by creator points.
4
+
5
+ ## Parameters
6
+ None!
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getCreatorScores().then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ [
17
+ {
18
+ username: 'YunHaSeu14',
19
+ playerID: 36314,
20
+ accountID: 1187377,
21
+ rank: 1,
22
+ stars: 33615,
23
+ diamonds: 68501,
24
+ secretCoins: 121,
25
+ userCoins: 9431,
26
+ demons: 123,
27
+ creatorPoints: 290
28
+ },
29
+ {
30
+ username: 'ViPriN',
31
+ playerID: 1078150,
32
+ accountID: 2795,
33
+ rank: 2,
34
+ stars: 29533,
35
+ diamonds: 28327,
36
+ secretCoins: 149,
37
+ userCoins: 3256,
38
+ demons: 1026,
39
+ creatorPoints: 281
40
+ },
41
+ {
42
+ username: 'Serponge',
43
+ playerID: 4170784,
44
+ accountID: 119741,
45
+ rank: 3,
46
+ stars: 85,
47
+ diamonds: 17,
48
+ secretCoins: 0,
49
+ userCoins: 5,
50
+ demons: 1,
51
+ creatorPoints: 234
52
+ }
53
+ ...and so on
54
+ ```
55
+
56
+ This function returns an array of [user objects](./objects/user.md).
57
+
58
+ ---
59
+
60
+ **NOTE:** Here, the users' rank is their actual position on the leaderboard.
@@ -3,7 +3,7 @@
3
3
  Gets the list of gauntlets and decodes it.
4
4
 
5
5
  ## Parameters
6
- No parameters!
6
+ None!
7
7
 
8
8
  ## Example
9
9
  ```js
@@ -0,0 +1,51 @@
1
+ # getLevelByID()
2
+
3
+ Gets the basic info about the level by its ID.
4
+
5
+ ## Parameters
6
+ `level` - the level ID.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getLevelByID(11940).then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ {
17
+ id: 11940,
18
+ name: 'Level Easy',
19
+ description: 'Cody',
20
+ creator: '-',
21
+ level_version: 1,
22
+ difficulty: 'Normal',
23
+ stars: 3,
24
+ downloads: 66447749,
25
+ likes: 3781481,
26
+ disliked: false,
27
+ length: 'Long',
28
+ demon: false,
29
+ featured: true,
30
+ epic: false,
31
+ objects: 0,
32
+ stars_requested: 0,
33
+ game_version: 'Pre-1.7',
34
+ copied: 0,
35
+ two_p: false,
36
+ coins: 0,
37
+ verified_coins: false,
38
+ song: {
39
+ name: 'Stereo Madness',
40
+ id: 'Level 1',
41
+ artist: 'ForeverBound',
42
+ link: 'https://www.youtube.com/watch?v=JhKyKEDxo8Q'
43
+ }
44
+ }
45
+ ```
46
+
47
+ Returns a [level object](./objects/level.md).
48
+
49
+ ---
50
+
51
+ **NOTE:** This is pretty much the same thing as `dlLevel()`, but `getLevelByID()` doesn't provide the password, update and upload date and the LDM checkbox. On the other hand, it's much faster (especially for object-heavy levels).
@@ -0,0 +1,56 @@
1
+ # getTop100()
2
+
3
+ Gets the top 100 players leaderboard, sorted by stars.
4
+
5
+ ## Parameters
6
+ None!
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getTop100().then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ [
17
+ {
18
+ username: 'Smiffy777',
19
+ playerID: 7708568,
20
+ accountID: 1413859,
21
+ rank: 1,
22
+ stars: 227040,
23
+ diamonds: 156320,
24
+ secretCoins: 149,
25
+ userCoins: 45920,
26
+ demons: 5581,
27
+ creatorPoints: 0
28
+ },
29
+ {
30
+ username: 'Gormuck',
31
+ playerID: 8247386,
32
+ accountID: 1775477,
33
+ rank: 2,
34
+ stars: 222121,
35
+ diamonds: 166422,
36
+ secretCoins: 149,
37
+ userCoins: 28509,
38
+ demons: 5050,
39
+ creatorPoints: 2
40
+ },
41
+ {
42
+ username: 'volplay',
43
+ playerID: 14188128,
44
+ accountID: 5189757,
45
+ rank: 3,
46
+ stars: 221320,
47
+ diamonds: 121349,
48
+ secretCoins: 149,
49
+ userCoins: 25076,
50
+ demons: 5291,
51
+ creatorPoints: 2
52
+ }
53
+ ...and so on
54
+ ```
55
+
56
+ This function returns an array of [user objects](./objects/user.md).
@@ -0,0 +1,84 @@
1
+ # getUserLevels()
2
+
3
+ Gets the list of levels made by a specified user.
4
+
5
+ ## Parameters
6
+ `user` - the user's username or a player ID.
7
+
8
+ `page` (optional) - the page. Defaults to 1.
9
+
10
+ ## Example
11
+ ```js
12
+ const gd = require("gj-boomlings-api");
13
+ gd.getUserLevels("shikoshib", 2).then(console.log);
14
+ ```
15
+
16
+ ## Response
17
+ ```
18
+ [
19
+ {
20
+ id: 79650761,
21
+ name: 'Lost or Not',
22
+ description: "I'm going to make a level trilogy with my own song. Part 2 soon!",
23
+ creator: 'shikoshib',
24
+ level_version: 1,
25
+ difficulty: 'Harder',
26
+ stars: 0,
27
+ downloads: 139,
28
+ likes: 13,
29
+ disliked: false,
30
+ length: 'Long',
31
+ demon: false,
32
+ featured: false,
33
+ epic: false,
34
+ objects: 12020,
35
+ stars_requested: 6,
36
+ game_version: '2.1',
37
+ copied: 0,
38
+ two_p: false,
39
+ coins: 3,
40
+ verified_coins: false,
41
+ song: {
42
+ name: 'Not Lost',
43
+ id: 1107430,
44
+ artist: 'shikoshib',
45
+ artistId: 10001037,
46
+ fileSize: '8.5 MB',
47
+ link: 'https://audio.ngfiles.com/1107000/1107430_Not-Lost.mp3?f1643365615'
48
+ }
49
+ },
50
+ {
51
+ id: 76643578,
52
+ name: 'Ok Just Get It',
53
+ description: 'pass 2305',
54
+ creator: 'shikoshib',
55
+ level_version: 1,
56
+ difficulty: 'Harder',
57
+ stars: 0,
58
+ downloads: 96,
59
+ likes: 13,
60
+ disliked: false,
61
+ length: 'Long',
62
+ demon: false,
63
+ featured: false,
64
+ epic: false,
65
+ objects: 4568,
66
+ stars_requested: 2,
67
+ game_version: '2.1',
68
+ copied: 0,
69
+ two_p: false,
70
+ coins: 0,
71
+ verified_coins: false,
72
+ song: {
73
+ name: 'F-777 - Medusa',
74
+ id: 798747,
75
+ artist: 'F-777',
76
+ artistId: 286,
77
+ fileSize: '7.39 MB',
78
+ link: 'https://audio.ngfiles.com/798000/798747_F-777---Medusa.mp3?f1522612006'
79
+ }
80
+ }
81
+ ]
82
+ ```
83
+
84
+ Returns an array of [level objects](./objects/level.md).
@@ -80,7 +80,7 @@ Used by ```dlLevel()```.
80
80
 
81
81
  ```stars_requested``` - basically how many stars the creator has requested. Returns ```0``` if no stars have been requested.
82
82
 
83
- ```game_version``` - the version required to play the level.
83
+ ```game_version``` - the version required to play the level. Returns `Pre-1.7` if the level has been uploaded or last updated earlier, than 1.7 came out.
84
84
 
85
85
  ```ldm``` - a boolean that shows if the level has a "Low Detail Mode" checkbox.
86
86
 
@@ -0,0 +1,113 @@
1
+ # searchLevels()
2
+
3
+ Searches the levels by a specified query.
4
+
5
+ ## Parameters
6
+ `query` - the search string, for example, the level name. If you'll leave it empty, you'll just get the list of most liked levels.
7
+
8
+ `page` (optional) - the page. Defaults to 1.
9
+
10
+ ## Example
11
+ ```js
12
+ const gd = require("gj-boomlings-api");
13
+ gd.searchLevels("", 2).then(console.log);
14
+ ```
15
+
16
+ ## Response
17
+ ```
18
+ [
19
+ {
20
+ id: 27319926,
21
+ name: 'through time',
22
+ description: 'Run... run through time. For you all! Follow me on twitter: @ItsBerkoo',
23
+ creator: 'Berkoo',
24
+ level_version: 2,
25
+ difficulty: 'Normal',
26
+ stars: 3,
27
+ downloads: 28632458,
28
+ likes: 2503368,
29
+ disliked: false,
30
+ length: 'Long',
31
+ demon: false,
32
+ featured: true,
33
+ epic: false,
34
+ objects: 0,
35
+ stars_requested: 2,
36
+ game_version: '2.0',
37
+ copied: 0,
38
+ two_p: false,
39
+ coins: 1,
40
+ verified_coins: true,
41
+ song: {
42
+ name: 'Promises',
43
+ id: 678497,
44
+ artist: 'KabukiTunes',
45
+ artistId: 47258,
46
+ fileSize: '8.23 MB',
47
+ link: 'http://audio.ngfiles.com/678000/678497_Promises.mp3'
48
+ }
49
+ },
50
+ {
51
+ id: 28179535,
52
+ name: 'Acid Factory',
53
+ description: 'Geometry dash - Poison Gauntlet - Thanks for play! [Acid Factory] 11,000,000 Downloads! <3 ',
54
+ creator: 'TrinckyFinki',
55
+ level_version: 3,
56
+ difficulty: 'Hard',
57
+ stars: 4,
58
+ downloads: 51023385,
59
+ likes: 2446217,
60
+ disliked: false,
61
+ length: 'Long',
62
+ demon: false,
63
+ featured: true,
64
+ epic: false,
65
+ objects: 14193,
66
+ stars_requested: 3,
67
+ game_version: '2.1',
68
+ copied: 28178503,
69
+ two_p: false,
70
+ coins: 3,
71
+ verified_coins: true,
72
+ song: {
73
+ name: 'VGMusicRox - Frantic Factory (',
74
+ id: 550260,
75
+ artist: 'Viproxi',
76
+ artistId: 4107,
77
+ fileSize: '5.94 MB',
78
+ link: 'http://audio.ngfiles.com/550000/550260_VGMusicRox---Frantic-Facto.mp3'
79
+ }
80
+ },
81
+ {
82
+ id: 55520,
83
+ name: 'THE LIGHTNING ROAD',
84
+ description: 'Removed Coins, ~ Timeless Real / Reduloc',
85
+ creator: 'timeless real',
86
+ level_version: 3,
87
+ difficulty: 'Easy Demon',
88
+ stars: 10,
89
+ downloads: 44657564,
90
+ likes: 2440721,
91
+ disliked: false,
92
+ length: 'Long',
93
+ demon: true,
94
+ featured: true,
95
+ epic: false,
96
+ objects: 3527,
97
+ stars_requested: 10,
98
+ game_version: '2.1',
99
+ copied: 55520,
100
+ two_p: false,
101
+ coins: 0,
102
+ verified_coins: false,
103
+ song: {
104
+ name: 'Dry Out',
105
+ id: 'Level 4',
106
+ artist: 'DJVI',
107
+ link: 'https://www.youtube.com/watch?v=FnXabH2q2A0'
108
+ }
109
+ },
110
+ ...and so on
111
+ ```
112
+
113
+ Returns an array of [level objects](./objects/level.md), sorted by the amount of likes.
@@ -0,0 +1,23 @@
1
+ # updateLevelDesc()
2
+
3
+ Updates the description of a level.
4
+
5
+ ## Parameters
6
+ `level` - the level ID.
7
+
8
+ `description` - the new description of a level.
9
+
10
+ `user` - the username or player ID.
11
+
12
+ `gjp` - the user's password.
13
+
14
+ ## Example
15
+ ```js
16
+ const gd = require("gj-boomlings-api");
17
+ gd.updateLevelDesc("83430836", "I love gj-boomlings-api!", "gmdshxdow", "*********").then(console.log);
18
+ ```
19
+
20
+ ## Response
21
+ ```js
22
+ 1
23
+ ```
@@ -0,0 +1,62 @@
1
+ module.exports = {
2
+ blockUser:
3
+ async function(target, username, password) {
4
+ if(!target || target == "") throw new Error("Please provide a player ID or username!");
5
+ if(!username || username == "") throw new Error("Please provide your player ID or username!");
6
+ if(!password || password == "") throw new Error("Please provide your password!");
7
+ const axios = require("axios");
8
+ const {headers, server} = require("../config.json");
9
+
10
+ let resp = await axios.post(server + "getGJUsers20.php", {
11
+ gameVersion: 21,
12
+ binaryVersion: 35,
13
+ gdw: 0,
14
+ str: username,
15
+ secret: "Wmfd2893gb7"
16
+ }, {
17
+ headers: headers
18
+ }).catch(e => {
19
+ if(e.response.data == -1) throw new Error(`Couldn't find a "${username}" user.`)
20
+ throw new Error(e.response.data)
21
+ })
22
+
23
+ let accID = resp.data.split(":16:")[1].split(":3:")[0];
24
+
25
+ const userData = {
26
+ gameVersion: 21,
27
+ binaryVersion: 35,
28
+ gdw: 0,
29
+ str: target,
30
+ secret: "Wmfd2893gb7"
31
+ }
32
+
33
+ let r = await axios.post(server + "getGJUsers20.php", userData, {
34
+ headers: headers
35
+ }).catch(e => {
36
+ if(e.response.data == -1) throw new Error(`Couldn't find a "${username}" user.`)
37
+ throw new Error(e.response.data)
38
+ })
39
+ let targetId = r.data.split(":16:")[1].split(":3:")[0];
40
+
41
+ const {gjp} = require("../misc/gjp.js");
42
+
43
+ const blockData = {
44
+ gameVersion: 21,
45
+ binaryVersion: 35,
46
+ gdw: 0,
47
+ secret: "Wmfd2893gb7",
48
+ targetAccountID: targetId,
49
+ accountID: accID,
50
+ gjp: gjp(password)
51
+ }
52
+
53
+ let res = await axios.post(server + "blockGJUser20.php", blockData, {
54
+ headers: headers
55
+ }).catch(e => {
56
+ if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
57
+ throw new Error(e)
58
+ })
59
+
60
+ return 1;
61
+ }
62
+ }
@@ -0,0 +1,51 @@
1
+ module.exports = {
2
+ deleteAccountPost:
3
+ async function(id, str, password) {
4
+ const {encURLSafeBase64} = require("./encURLSafeBase64.js");
5
+ if(!id || id == "") throw new Error("Please provide an account post ID!");
6
+ if(!str || str == "") throw new Error("Please provide a user ID or name!");
7
+ if(!password || password == "") throw new Error("Please provide a password!");
8
+
9
+ const axios = require("axios");
10
+ const { headers, server } = require("../config.json");
11
+
12
+ const data = {
13
+ gameVersion: 21,
14
+ binaryVersion: 35,
15
+ gdw: 0,
16
+ str: str,
17
+ secret: "Wmfd2893gb7"
18
+ };
19
+
20
+ let r = await axios.post(server + "getGJUsers20.php", data, {
21
+ headers: headers
22
+ }).catch(e => {
23
+ if(e.response.data == -1) throw new Error("-1 This user is not found.");
24
+ throw new Error(e.response.data);
25
+ })
26
+
27
+ let accId = r.data.split(":16:")[1].split(":3:")[0];
28
+ if(Number(accId) < 71 || accId.includes(":")) accId = r.data.split(":16:")[2].split(":3:")[0];
29
+
30
+ const XOR = require("../misc/xor.js");
31
+ const xor = new XOR();
32
+
33
+ let dACdata = {
34
+ gameVersion: 21,
35
+ binaryVersion: 35,
36
+ gdw: 0,
37
+ accountID: accId,
38
+ secret: "Wmfd2893gb7",
39
+ gjp: xor.encrypt(password, 37526),
40
+ commentID: id,
41
+ };
42
+
43
+ let res = await axios.post(server + "deleteGJAccComment20.php", dACdata, {
44
+ headers: headers
45
+ }).catch(e => {
46
+ throw new Error(e.response.data);
47
+ })
48
+
49
+ return 1;
50
+ }
51
+ }
@@ -22,8 +22,9 @@ module.exports = {
22
22
  headers: headers
23
23
  })
24
24
 
25
- if(res.data == -1) throw new Error("-1 Not found.")
26
- if(res.data.toLowerCase() == "error code: 1005") throw new Error("1005 error: Your IP address has been blocked from sending requests to a server. It's recommended to use locally (directly from a PC).")
25
+ if(res.data == -1) throw new Error("-1 Not found.");
26
+ if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
27
+ if(res.data.toLowerCase() == "error code: 1005") throw new Error("1005 error: Your IP address has been blocked from sending requests to a server. It's recommended to use locally (directly from a PC).");
27
28
  let split1 = res.data.split("1:")[1]; // id
28
29
  let split2 = res.data.split(":2:")[1]; // name
29
30
  let split3 = res.data.split(":3:")[1]; // description