gj-boomlings-api 0.1.7 → 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 +1 -1
- package/functions/getComments.js +37 -0
- package/functions/reportLevel.js +23 -0
- package/index.js +4 -2
- package/misc/decodeGJComment.js +35 -0
- package/package.json +3 -2
- package/t.txt +0 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Returns:
|
|
|
80
80
|
friendRequests: 'none',
|
|
81
81
|
commentHistory: 'all',
|
|
82
82
|
mod: 'elder',
|
|
83
|
-
youtube: 'https://youtube.com/channel/
|
|
83
|
+
youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw',
|
|
84
84
|
twitter: 'https://twitter.com/RobTopGames',
|
|
85
85
|
twitch: 'https://twitch.tv/robtopgames'
|
|
86
86
|
}
|
|
@@ -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
|
+
}
|
|
@@ -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;
|
|
@@ -17,5 +19,5 @@ module.exports.encURLSafeBase64 = encURLSafeBase64;
|
|
|
17
19
|
module.exports.getDailyLevel = getDailyLevel;
|
|
18
20
|
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
19
21
|
module.exports.getProfile = getProfile;
|
|
20
|
-
|
|
21
|
-
|
|
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.
|
|
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": {
|
package/t.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1:Ivav12:2:134186837:13:4:17:0:10:12:11:9:3:142:46:9:4:13:8:3:18:0:19:0:50:0:20::21:26:22:32:23:10:24:6:25:15:26:24:28:0:43:15:48:1:30:0:16:13768920:31:0:44::45::49:0:29:1
|