gj-boomlings-api 0.1.6 → 0.2.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.
package/README.md CHANGED
@@ -10,45 +10,45 @@ So basically this function downloads the entire level and converts the response
10
10
 
11
11
  ```js
12
12
  const gd = require("gj-boomlings-api");
13
- gd.dlLevel(42584142).then(console.log);
13
+ gd.dlLevel(58825144).then(console.log);
14
14
  ```
15
15
 
16
16
  Returns:
17
17
 
18
18
  ```
19
19
  {
20
- id: 42584142,
21
- name: 'Bloodlust',
22
- description: 'Your thirst for blood continues? Very well, let the blood spill. Let the demons feed off your unfortunate soul...',
23
- creator: 'Knobbelboy',
24
- level_version: 3,
20
+ id: 58825144,
21
+ name: 'xo',
22
+ description: 'stream vertigo',
23
+ creator: 'KrmaL',
24
+ level_version: 2,
25
25
  difficulty: 'Extreme Demon',
26
26
  stars: 10,
27
- downloads: 18396549,
28
- likes: 682303,
27
+ downloads: 2587512,
28
+ likes: 106611,
29
29
  disliked: false,
30
30
  length: 'XL',
31
- password: '121296',
31
+ password: '000007',
32
32
  demon: true,
33
- featured: true,
34
- epic: true,
35
- objects: 65535,
36
- uploaded: '4 years',
37
- updated: '5 months',
33
+ featured: false,
34
+ epic: false,
35
+ objects: 37838,
36
+ uploaded: '2 years',
37
+ updated: '2 years',
38
38
  stars_requested: 10,
39
39
  game_version: '2.1',
40
40
  ldm: false,
41
- copied: 25066306,
41
+ copied: 0,
42
42
  two_p: false,
43
43
  coins: 0,
44
44
  verified_coins: false,
45
45
  song: {
46
- name: 'At the Speed of Light',
47
- id: 467339,
48
- artist: 'Dimrain47',
49
- artistId: 52,
50
- fileSize: '9.56 MB',
51
- link: 'https://geometrydashcontent.b-cdn.net/songs/467339.mp3'
46
+ name: 'XO (Eden Cover & Remake)',
47
+ id: 766165,
48
+ artist: 'aaronmusslewhite',
49
+ artistId: 2130,
50
+ fileSize: '6.1 MB',
51
+ link: 'http://audio.ngfiles.com/766000/766165_XO-Eden-Cover-amp-Remake.mp3'
52
52
  }
53
53
  }
54
54
  ```
@@ -80,7 +80,7 @@ Returns:
80
80
  friendRequests: 'none',
81
81
  commentHistory: 'all',
82
82
  mod: 'elder',
83
- youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw1231',
83
+ youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw',
84
84
  twitter: 'https://twitter.com/RobTopGames',
85
85
  twitch: 'https://twitch.tv/robtopgames'
86
86
  }
@@ -14,7 +14,7 @@ module.exports = {
14
14
  gameVersion: 21,
15
15
  binaryVersion: 35,
16
16
  gdw: 0,
17
- levelID: level,
17
+ levelID: level.trim(),
18
18
  secret: "Wmfd2893gb7"
19
19
  }
20
20
 
@@ -0,0 +1,37 @@
1
+ module.exports = {
2
+ getComments:
3
+ async function(level, page = 1, mode = 1) {
4
+ const axios = require("axios");
5
+ const {headers} = require("../config.json");
6
+ const { decodeGJComment } = require("../misc/decodeGJComment.js");
7
+
8
+ const data = {
9
+ levelID: level,
10
+ page: page - 1,
11
+ mode: mode,
12
+ secret: "Wmfd2893gb7",
13
+ gameVersion: 21,
14
+ binaryVersion: 35,
15
+ gdw: 0
16
+ }
17
+
18
+ let res = await axios.post("http://www.boomlings.com/database/getGJComments21.php", data, {
19
+ headers: headers
20
+ })
21
+
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)]
34
+
35
+ return result;
36
+ }
37
+ }
@@ -17,8 +17,8 @@ module.exports = {
17
17
  headers: headers
18
18
  })
19
19
 
20
- let id = Number(r.data.split(":16:")[1].split(":3:")[0]);
21
- if(Number(id) < 71) id = Number(r.data.split(":16:")[2].split(":3:")[0]);
20
+ let id = r.data.split(":16:")[1].split(":3:")[0];
21
+ if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
22
22
 
23
23
  let GJUI20data = {
24
24
  gameVersion: 21,
@@ -35,7 +35,7 @@ module.exports = {
35
35
  if(res.data == -1) throw new Error("-1 Not found.")
36
36
  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).")
37
37
 
38
- let dataWoSkins = `${res.data.split(":21:")[0]}${res.data.split(":48:")[1]}`;
38
+ let dataWoSkins = `${res.data.split("21:")[0]}${res.data.split(":48:")[1]}`;
39
39
 
40
40
  let username = dataWoSkins.split("1:")[1].split(":2:")[0];
41
41
  let playerID = dataWoSkins.split(":2:")[1].split(":13:")[0];
@@ -48,14 +48,14 @@ module.exports = {
48
48
  let msgState = dataWoSkins.split(":18:")[1].split(":19:")[0];
49
49
  let friendsState = dataWoSkins.split(":19:")[1].split(":50:")[0];
50
50
  let commentHistoryState = dataWoSkins.split(":50:")[1].split(":20:")[0];
51
- let youtube = dataWoSkins.split(":20:")[1].split(":30:")[0];
51
+ let youtube = dataWoSkins.split(":20:")[1].split(":")[0];
52
52
  let rank = dataWoSkins.split(":30:")[1].split(":16:")[0];
53
53
  let accountID = dataWoSkins.split(":16:")[1].split(":31:")[0];
54
54
  let twitter = dataWoSkins.split(":44:")[1].split(":45:")[0];
55
55
  let twitch = dataWoSkins.split(":45:")[1].split(":49:")[0];
56
56
  let modState = dataWoSkins.split(":49:")[1].split(":29:")[0];
57
57
 
58
- if(youtube.includes(":")) youtube = dataWoSkins.split(":20:")[2].split(":30:")[0];
58
+ if(youtube.includes(":")) youtube = dataWoSkins.split(":20:")[1].split(":")[0];
59
59
  if(twitter.includes(":")) twitter = dataWoSkins.split(":44:")[2].split(":45:")[0];
60
60
  if(twitch.includes(":")) twitch = dataWoSkins.split(":45:")[2].split(":49:")[0];
61
61
  if(goldCoins.includes(":")) goldCoins = dataWoSkins.split(":13:")[2].split(":17:")[0];
@@ -66,10 +66,22 @@ module.exports = {
66
66
  if(demons.includes(":")) demons = dataWoSkins.split(":4:")[2].split(":8:")[0];
67
67
  if(msgState.includes(":")) msgState = dataWoSkins.split(":18:")[2].split(":19:")[0];
68
68
  if(stars.includes(":")) stars = dataWoSkins.split("3:")[2].split(":46:")[0];
69
- if(dataWoSkins.split("3:")[2].split(":46:")[0].includes(":")) stars = dataWoSkins.split("3:")[3].split(":46:")[0];
70
- if(dataWoSkins.split("3:")[3].split(":46:")[0] == "") stars = dataWoSkins.split("3:")[4].split(":46:")[0];
69
+ if(modState.includes(":")) modState = dataWoSkins.split(":49:")[2].split(":29:")[0];
70
+ if(dataWoSkins.split(":3:")[1].split(":46:")[0].startsWith("3:")) stars = dataWoSkins.split(":3:")[1].split("3:")[1].split(":46:")[0];
71
+ if(dataWoSkins.split("3:")[2].split(":46:")[0].includes(":")) {
72
+ stars = dataWoSkins.split("3:")[3].split(":46:")[0];
73
+ } else {
74
+ stars = stars;
75
+ }
76
+ if(dataWoSkins.split("3:")[3] != undefined || dataWoSkins.split("3:")[3] != "") {
77
+ if(dataWoSkins.split("3:")[3].split(":46:")[0] == "") {
78
+ stars = dataWoSkins.split("3:")[4].split(":46:")[0];
79
+ } else {
80
+ stars = stars;
81
+ }
82
+ }
71
83
 
72
- let ytLnk = `https://youtube.com/channel/${youtube}`;
84
+ let ytLnk = `htps://youtube.com/channel/${youtube}`;
73
85
  let twitterLnk = `https://twitter.com/${twitter}`;
74
86
  let twitchLnk = `https://twitch.tv/${twitch}`;
75
87
 
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ reportLevel:
3
+ async function(level) {
4
+ if(!level) throw new Error("Please provide a level ID.");
5
+ if(isNaN(Number(level))) throw new Error("The level ID should be a number.");
6
+
7
+ const axios = require("axios")
8
+ const {headers} = require("../config.json");
9
+
10
+ const data = {
11
+ levelID: Number(level),
12
+ secret: "Wmfd2893gb7"
13
+ }
14
+
15
+ let res = await axios.post("http://www.boomlings.com/database/reportGJLevel.php", data, {
16
+ headers: headers
17
+ })
18
+
19
+ if(res.data == -1) throw new Error("-1 Request denied.");
20
+
21
+ return res.data;
22
+ }
23
+ }
package/index.js CHANGED
@@ -7,6 +7,8 @@ const { encURLSafeBase64 } = require("./functions/encURLSafeBase64.js");
7
7
  const { getDailyLevel } = require("./functions/getDailyLevel.js");
8
8
  const { getWeeklyDemon } = require("./functions/getWeeklyDemon.js");
9
9
  const { getProfile } = require("./functions/getProfile.js");
10
+ const { reportLevel } = require("./functions/reportLevel.js");
11
+ const { getComments } = require("./functions/getComments.js");
10
12
 
11
13
  module.exports.dlLevel = dlLevel;
12
14
  module.exports.getLevelData = getLevelData;
@@ -16,4 +18,6 @@ module.exports.decURLSafeBase64 = decURLSafeBase64;
16
18
  module.exports.encURLSafeBase64 = encURLSafeBase64;
17
19
  module.exports.getDailyLevel = getDailyLevel;
18
20
  module.exports.getWeeklyDemon = getWeeklyDemon;
19
- module.exports.getProfile = getProfile;
21
+ module.exports.getProfile = getProfile;
22
+ module.exports.reportLevel = reportLevel;
23
+ module.exports.getComments = getComments;
@@ -0,0 +1,35 @@
1
+ module.exports = {
2
+ decodeGJComment:
3
+ function(comment) {
4
+ const bs = require("js-base64");
5
+
6
+ let commentContent = comment.split("2~")[1].split("~3~")[0];
7
+ let playerID = comment.split("~3~")[1].split("~4~")[0];
8
+ let likes = comment.split("~4~")[1].split("~7~")[0];
9
+ let isSpam = comment.split("~7~")[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
+
17
+ let isSpamDecoding = {
18
+ "0": false,
19
+ "1": true
20
+ }
21
+
22
+ const res = {
23
+ username: username,
24
+ content: bs.decode(commentContent.replace(/_/g, '/').replace(/-/g, '+')),
25
+ playerID: Number(playerID),
26
+ likes: Number(likes),
27
+ percent: Number(percent),
28
+ id: Number(messageID),
29
+ age: age,
30
+ isSpam: isSpamDecoding[isSpam]
31
+ }
32
+
33
+ return res;
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gj-boomlings-api",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "A Node.js module that allows you to fetch boomlings.com easily",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,7 +22,8 @@
22
22
  "gj",
23
23
  "boomlings",
24
24
  "api",
25
- "gaming"
25
+ "gaming",
26
+ "robtop"
26
27
  ],
27
28
  "license": "ISC",
28
29
  "dependencies": {