gj-boomlings-api 1.2.2 → 1.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.
Files changed (64) hide show
  1. package/functions/blockUser.js +5 -32
  2. package/functions/deleteAccountPost.js +3 -19
  3. package/functions/deleteComment.js +3 -22
  4. package/functions/dlLevel.js +12 -12
  5. package/functions/dlMessage.js +32 -0
  6. package/functions/getAccountPosts.js +9 -121
  7. package/functions/getCommentHistory.js +7 -121
  8. package/functions/getComments.js +5 -102
  9. package/functions/getCreatorScores.js +11 -203
  10. package/functions/getGauntlets.js +5 -33
  11. package/functions/getMapPacks.js +6 -20
  12. package/functions/getMessages.js +37 -0
  13. package/functions/getProfile.js +10 -22
  14. package/functions/getTop100.js +11 -203
  15. package/functions/getUserLevels.js +0 -16
  16. package/functions/searchUsers.js +22 -0
  17. package/functions/unblockUser.js +5 -32
  18. package/functions/updateLevelDesc.js +5 -19
  19. package/functions/uploadAccountPost.js +6 -20
  20. package/functions/uploadComment.js +7 -23
  21. package/functions/uploadMessage.js +39 -0
  22. package/index.js +9 -5
  23. package/misc/colors.json +44 -0
  24. package/misc/decB64.js +7 -0
  25. package/misc/decCommentFromHistory.js +2 -2
  26. package/misc/decMessage.js +34 -0
  27. package/misc/decMsg.js +30 -0
  28. package/misc/decScoresUser.js +45 -0
  29. package/misc/decodeAccountPost.js +2 -2
  30. package/misc/decodeGJComment.js +20 -13
  31. package/misc/decodeLevel.js +4 -4
  32. package/misc/decodeMapPack.js +1 -14
  33. package/misc/decodeUserResult.js +8 -9
  34. package/{functions/encURLSafeBase64.js → misc/encB64.js} +2 -3
  35. package/misc/rgbToHEX.js +16 -0
  36. package/package.json +2 -3
  37. package/docs/blockUser.md +0 -21
  38. package/docs/deleteAccountPost.md +0 -23
  39. package/docs/dlLevel.md +0 -52
  40. package/docs/getAccountPosts.md +0 -71
  41. package/docs/getCommentHistory.md +0 -123
  42. package/docs/getComments.md +0 -113
  43. package/docs/getCreatorScores.md +0 -60
  44. package/docs/getDailyLevel.md +0 -17
  45. package/docs/getGauntlets.md +0 -81
  46. package/docs/getLevelByID.md +0 -51
  47. package/docs/getMapPacks.md +0 -88
  48. package/docs/getOfficialSongInfo.md +0 -25
  49. package/docs/getProfile.md +0 -36
  50. package/docs/getSongInfo.md +0 -26
  51. package/docs/getTop100.md +0 -56
  52. package/docs/getUserLevels.md +0 -84
  53. package/docs/getWeeklyDemon.md +0 -17
  54. package/docs/objects/acc_comment.md +0 -19
  55. package/docs/objects/comment.md +0 -34
  56. package/docs/objects/level.md +0 -95
  57. package/docs/objects/song.md +0 -28
  58. package/docs/objects/user.md +0 -61
  59. package/docs/reportLevel.md +0 -19
  60. package/docs/searchLevels.md +0 -113
  61. package/docs/updateLevelDesc.md +0 -23
  62. package/docs/uploadAccountPost.md +0 -27
  63. package/docs/uploadComment.md +0 -28
  64. package/functions/decURLSafeBase64.js +0 -10
@@ -5,38 +5,11 @@ module.exports = {
5
5
  if(!username || username == "") throw new Error("Please provide your player ID or username!");
6
6
  if(!password || password == "") throw new Error("Please provide your password!");
7
7
  const axios = require("axios");
8
+ const { searchUsers } = require("./searchUsers.js");
8
9
  const {headers, server} = require("../config.json");
9
10
 
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];
11
+ let user = await searchUsers(username);
12
+ let targetObj = await searchUsers(username);
40
13
 
41
14
  const {gjp} = require("../misc/gjp.js");
42
15
 
@@ -45,8 +18,8 @@ module.exports = {
45
18
  binaryVersion: 35,
46
19
  gdw: 0,
47
20
  secret: "Wmfd2893gb7",
48
- targetAccountID: targetId,
49
- accountID: accID,
21
+ targetAccountID: targetObj.accountID,
22
+ accountID: user.accountID,
50
23
  gjp: gjp(password)
51
24
  }
52
25
 
@@ -1,31 +1,15 @@
1
1
  module.exports = {
2
2
  deleteAccountPost:
3
3
  async function(id, str, password) {
4
- const {encURLSafeBase64} = require("./encURLSafeBase64.js");
5
4
  if(!id || id == "") throw new Error("Please provide an account post ID!");
6
5
  if(!str || str == "") throw new Error("Please provide a user ID or name!");
7
6
  if(!password || password == "") throw new Error("Please provide a password!");
8
7
 
9
8
  const axios = require("axios");
10
9
  const { headers, server } = require("../config.json");
10
+ const { searchUsers } = require("./searchUsers.js");
11
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];
12
+ let user = await searchUsers(str);
29
13
 
30
14
  const XOR = require("../misc/xor.js");
31
15
  const xor = new XOR();
@@ -34,7 +18,7 @@ module.exports = {
34
18
  gameVersion: 21,
35
19
  binaryVersion: 35,
36
20
  gdw: 0,
37
- accountID: accId,
21
+ accountID: user.accountID,
38
22
  secret: "Wmfd2893gb7",
39
23
  gjp: xor.encrypt(password, 37526),
40
24
  commentID: id,
@@ -1,7 +1,6 @@
1
1
  module.exports = {
2
2
  deleteComment:
3
3
  async function(id, lvl, str, password) {
4
- const {encURLSafeBase64} = require("./encURLSafeBase64.js");
5
4
  if(!id || id == "") throw new Error("Please provide a comment ID!");
6
5
  if(!lvl || lvl == "") throw new Error("Please provide a level ID!");
7
6
  if(!str || str == "") throw new Error("Please provide a user ID or name!");
@@ -9,33 +8,15 @@ module.exports = {
9
8
 
10
9
  const axios = require("axios");
11
10
  const { headers, server } = require("../config.json");
11
+ const { searchUsers } = require("./searchUsers.js");
12
12
 
13
- const data = {
14
- gameVersion: 21,
15
- binaryVersion: 35,
16
- gdw: 0,
17
- str: str,
18
- secret: "Wmfd2893gb7"
19
- };
20
-
21
- let r = await axios.post(server + "getGJUsers20.php", data, {
22
- headers: headers
23
- }).catch(e => {
24
- if(e.response.data == -1) throw new Error("-1 This user is not found.");
25
- throw new Error(e.response.data);
26
- })
27
-
28
- let accId = r.data.split(":16:")[1].split(":3:")[0];
29
- if(Number(accId) < 71 || accId.includes(":")) accId = r.data.split(":16:")[2].split(":3:")[0];
13
+ let user = await searchUsers(str);
30
14
 
31
15
  const XOR = require("../misc/xor.js");
32
16
  const xor = new XOR();
33
17
 
34
18
  let dACdata = {
35
- gameVersion: 21,
36
- binaryVersion: 35,
37
- gdw: 0,
38
- accountID: accId,
19
+ accountID: user.accountID,
39
20
  secret: "Wmfd2893gb7",
40
21
  levelID: lvl,
41
22
  gjp: xor.encrypt(password, 37526),
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  dlLevel:
3
3
  async function(level) {
4
- const bs = require("js-base64");
4
+ const {decB64} = require("../misc/decB64.js");
5
5
  const zlib = require("zlib");
6
6
  if(!level || level == "") throw new Error("Please provide a level ID.");
7
7
  if(isNaN(level)) throw new Error("The level parameter should be a number.");
@@ -37,12 +37,11 @@ module.exports = {
37
37
 
38
38
  let id = levelInfo[0].split("1:")[1];
39
39
  let name = levelInfo[1].split("2:")[1];
40
- let description = bs.decode(levelInfo[2].split("3:")[1])
40
+ let description = decB64(levelInfo[2].split("3:")[1])
41
41
  let levelStr = levelInfo[3].split("4:")[1];
42
42
  let version = levelInfo[4].split("5:")[1];
43
43
  let difficulty = levelInfo[7].split("9:")[1];
44
44
  let downloads = levelInfo[8].split("10:")[1];
45
- let officialSong = levelInfo[9].split("12:")[1];
46
45
  let gameVersion = levelInfo[10].split("13:")[1];
47
46
  let likes = levelInfo[11].split("14:")[1];
48
47
  let demonBool = levelInfo[12].split("17:")[1];
@@ -54,13 +53,14 @@ module.exports = {
54
53
  let twoPlayer = levelInfo[21].split("31:")[1];
55
54
  let uploaded = levelInfo[22].split("28:")[1];
56
55
  let updated = levelInfo[23].split("29:")[1];
57
- let customSong = levelInfo[24].split("35:")[1];
58
56
  let coins = levelInfo[26].split("37:")[1];
59
57
  let verifiedCoins = levelInfo[27].split("38:")[1];
60
58
  let starsRequested = levelInfo[28].split("39:")[1];
61
59
  let ldm = levelInfo[31].split("40:")[1];
62
60
  let password = xor.decrypt(levelInfo[32].split("27:")[1].split("#")[0], 26364);
63
61
 
62
+ if(password.length == 7) password = password.replace("1", "");
63
+
64
64
  let disliked = false;
65
65
  if(likes.includes("-")) disliked = true;
66
66
 
@@ -137,12 +137,12 @@ module.exports = {
137
137
  if(description == '') description = "(No description provided)";
138
138
 
139
139
  const { getLevelByID } = require("./getLevelByID.js");
140
- let basicInfoAboutLevel = await getLevelByID(id);
140
+ let getLvl = await getLevelByID(id);
141
141
  let result = {
142
142
  id: Number(id),
143
143
  name: name,
144
144
  description: description,
145
- creator: basicInfoAboutLevel.creator,
145
+ creator: getLvl.creator,
146
146
  level_version: Number(version),
147
147
  difficulty: difficultyDecoding[difficulty],
148
148
  stars: Number(stars),
@@ -150,7 +150,7 @@ module.exports = {
150
150
  likes: Number(likes),
151
151
  disliked: disliked,
152
152
  length: lengthDecoding[length],
153
- password: password.replace("1", ""),
153
+ password: password,
154
154
  demon: demonBoolDecoding[demonBool],
155
155
  featured: featured,
156
156
  epic: demonBoolDecoding[epic],
@@ -164,15 +164,15 @@ module.exports = {
164
164
  two_p: demonBoolDecoding[twoPlayer],
165
165
  coins: Number(coins),
166
166
  verified_coins: verifiedCoins,
167
- song: basicInfoAboutLevel.song,
167
+ song: getLvl.song,
168
168
  }
169
169
 
170
- if(basicInfoAboutLevel.pointercrate != undefined) {
170
+ if(getLvl.pointercrate != undefined) {
171
171
  result = {
172
172
  id: Number(id),
173
173
  name: name,
174
174
  description: description,
175
- creator: basicInfoAboutLevel.creator,
175
+ creator: getLvl.creator,
176
176
  level_version: Number(version),
177
177
  difficulty: difficultyDecoding[difficulty],
178
178
  stars: Number(stars),
@@ -194,8 +194,8 @@ module.exports = {
194
194
  two_p: demonBoolDecoding[twoPlayer],
195
195
  coins: Number(coins),
196
196
  verified_coins: verifiedCoins,
197
- song: basicInfoAboutLevel.song,
198
- pointercrate: basicInfoAboutLevel.pointercrate
197
+ song: getLvl.song,
198
+ pointercrate: getLvl.pointercrate
199
199
  }
200
200
  }
201
201
 
@@ -0,0 +1,32 @@
1
+ module.exports = {
2
+ dlMessage:
3
+ async function(id, user, pass) {
4
+ if(!id || id == "") throw new Error("Please provide a message ID!");
5
+ if(Number(id) == NaN) throw new Error("The message ID should be a number!");
6
+ if(!user || user == "") throw new Error("Please provide your player ID or username!");
7
+ if(!pass || pass == "") throw new Error("Please provide your password!");
8
+
9
+ const axios = require("axios");
10
+ const {headers, server, secret} = require("../config.json");
11
+ const { searchUsers } = require("./searchUsers.js");
12
+ const {gjp} = require("../misc/gjp.js");
13
+ const {decMessage} = require("../misc/decMessage.js");
14
+
15
+ let userObj = await searchUsers(user);
16
+
17
+ const msgData = {
18
+ accountID: userObj.accountID,
19
+ gjp: gjp(pass),
20
+ secret: secret,
21
+ messageID: id
22
+ }
23
+
24
+ let res = await axios.post(server + "downloadGJMessage20.php", msgData, {
25
+ headers: headers
26
+ }).catch(e => {
27
+ throw new Error(e.response.data)
28
+ })
29
+
30
+ return decMessage(res.data);
31
+ }
32
+ }
@@ -5,30 +5,15 @@ module.exports = {
5
5
  const { decodeAccountPost } = require("../misc/decodeAccountPost.js");
6
6
  const axios = require("axios");
7
7
  const { headers, server } = require("../config.json");
8
+ const { searchUsers } = require("./searchUsers.js");
8
9
 
9
- const data = {
10
- gameVersion: 21,
11
- binaryVersion: 35,
12
- gdw: 0,
13
- str: str,
14
- secret: "Wmfd2893gb7"
15
- };
16
-
17
- let r = await axios.post(server + "getGJUsers20.php", data, {
18
- headers: headers
19
- }).catch(e => {
20
- if(e.response.data == -1) throw new Error("-1 This user is not found.");
21
- throw new Error(e.response.data);
22
- })
23
-
24
- let id = r.data.split(":16:")[1].split(":3:")[0];
25
- if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
10
+ let user = await searchUsers(str);
26
11
 
27
12
  let ACdata = {
28
13
  gameVersion: 21,
29
14
  binaryVersion: 35,
30
15
  gdw: 0,
31
- accountID: id,
16
+ accountID: user.accountID,
32
17
  secret: "Wmfd2893gb7",
33
18
  page: page - 1
34
19
  };
@@ -40,109 +25,12 @@ module.exports = {
40
25
  if(e.response.data.startsWith("#")) throw new Error("Whoops! Couldn't find anything!");
41
26
  throw new Error(e.response.data);
42
27
  })
43
-
44
- let firstPost = res.data;
45
- let secondPost;
46
- let thirdPost;
47
- let fourthPost;
48
- let fifthPost;
49
- let sixthPost;
50
- let seventhPost;
51
- let eighthPost;
52
- let ninthPost;
53
- let tenthPost;
54
-
55
- let result = [decodeAccountPost(firstPost)]
56
-
57
- if(res.data.split("|").length - 1 == 1) {
58
- firstPost = res.data.split("|")[0];
59
- secondPost = res.data.split("|")[1].split("|")[0];
60
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost)]
61
- }
62
-
63
- if(res.data.split("|").length - 1 == 2) {
64
- firstPost = res.data.split("|")[0];
65
- secondPost = res.data.split("|")[1].split("|")[0];
66
- thirdPost = res.data.split("|")[2].split("|")[0];
67
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost)]
68
- }
69
-
70
- if(res.data.split("|").length - 1 == 3) {
71
- firstPost = res.data.split("|")[0];
72
- secondPost = res.data.split("|")[1].split("|")[0];
73
- thirdPost = res.data.split("|")[2].split("|")[0];
74
- fourthPost = res.data.split("|")[3].split("|")[0];
75
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost)]
76
- }
77
-
78
- if(res.data.split("|").length - 1 == 4) {
79
- firstPost = res.data.split("|")[0];
80
- secondPost = res.data.split("|")[1].split("|")[0];
81
- thirdPost = res.data.split("|")[2].split("|")[0];
82
- fourthPost = res.data.split("|")[3].split("|")[0];
83
- fifthPost = res.data.split("|")[4].split("|")[0];
84
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost)]
85
- }
86
-
87
- if(res.data.split("|").length - 1 == 5) {
88
- firstPost = res.data.split("|")[0];
89
- secondPost = res.data.split("|")[1].split("|")[0];
90
- thirdPost = res.data.split("|")[2].split("|")[0];
91
- fourthPost = res.data.split("|")[3].split("|")[0];
92
- fifthPost = res.data.split("|")[4].split("|")[0];
93
- sixthPost = res.data.split("|")[5].split("|")[0];
94
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost),decodeAccountPost(sixthPost)]
95
- }
96
-
97
- if(res.data.split("|").length - 1 == 6) {
98
- firstPost = res.data.split("|")[0];
99
- secondPost = res.data.split("|")[1].split("|")[0];
100
- thirdPost = res.data.split("|")[2].split("|")[0];
101
- fourthPost = res.data.split("|")[3].split("|")[0];
102
- fifthPost = res.data.split("|")[4].split("|")[0];
103
- sixthPost = res.data.split("|")[5].split("|")[0];
104
- seventhPost = res.data.split("|")[6].split("|")[0];
105
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost),decodeAccountPost(sixthPost),decodeAccountPost(seventhPost)]
106
- }
107
-
108
- if(res.data.split("|").length - 1 == 7) {
109
- firstPost = res.data.split("|")[0];
110
- secondPost = res.data.split("|")[1].split("|")[0];
111
- thirdPost = res.data.split("|")[2].split("|")[0];
112
- fourthPost = res.data.split("|")[3].split("|")[0];
113
- fifthPost = res.data.split("|")[4].split("|")[0];
114
- sixthPost = res.data.split("|")[5].split("|")[0];
115
- seventhPost = res.data.split("|")[6].split("|")[0];
116
- eighthPost = res.data.split("|")[7].split("|")[0];
117
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost),decodeAccountPost(sixthPost),decodeAccountPost(seventhPost),decodeAccountPost(eighthPost)]
118
- }
119
-
120
- if(res.data.split("|").length - 1 == 8) {
121
- firstPost = res.data.split("|")[0];
122
- secondPost = res.data.split("|")[1].split("|")[0];
123
- thirdPost = res.data.split("|")[2].split("|")[0];
124
- fourthPost = res.data.split("|")[3].split("|")[0];
125
- fifthPost = res.data.split("|")[4].split("|")[0];
126
- sixthPost = res.data.split("|")[5].split("|")[0];
127
- seventhPost = res.data.split("|")[6].split("|")[0];
128
- eighthPost = res.data.split("|")[7].split("|")[0];
129
- ninthPost = res.data.split("|")[8].split("|")[0];
130
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost),decodeAccountPost(sixthPost),decodeAccountPost(seventhPost),decodeAccountPost(eighthPost),decodeAccountPost(ninthPost)]
131
- }
132
-
133
- if(res.data.split("|").length - 1 == 9) {
134
- firstPost = res.data.split("|")[0];
135
- secondPost = res.data.split("|")[1].split("|")[0];
136
- thirdPost = res.data.split("|")[2].split("|")[0];
137
- fourthPost = res.data.split("|")[3].split("|")[0];
138
- fifthPost = res.data.split("|")[4].split("|")[0];
139
- sixthPost = res.data.split("|")[5].split("|")[0];
140
- seventhPost = res.data.split("|")[6].split("|")[0];
141
- eighthPost = res.data.split("|")[7].split("|")[0];
142
- ninthPost = res.data.split("|")[8].split("|")[0];
143
- tenthPost = res.data.split("|")[9].split("|")[0];
144
- result = [decodeAccountPost(firstPost),decodeAccountPost(secondPost),decodeAccountPost(thirdPost),decodeAccountPost(fourthPost),decodeAccountPost(fifthPost),decodeAccountPost(sixthPost),decodeAccountPost(seventhPost),decodeAccountPost(eighthPost),decodeAccountPost(ninthPost),decodeAccountPost(tenthPost)]
145
- }
28
+
29
+ let accPosts = res.data.split("|");
30
+ let result = [];
31
+ accPosts.forEach(p => {
32
+ result.push(decodeAccountPost(p));
33
+ })
146
34
 
147
35
  return result;
148
36
  }
@@ -6,24 +6,7 @@ module.exports = {
6
6
  const {headers, server} = require("../config.json");
7
7
  const {decCommentFromHistory} = require("../misc/decCommentFromHistory.js");
8
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
- }).catch(e => {
21
- if(e.response.data == -1) throw new Error("-1 This user is not found.");
22
- throw new Error(e.response.data);
23
- })
24
-
25
- let id = r.data.split(":2:")[1].split(":13:")[0];
26
-
9
+
27
10
  const user = await getProfile(id);
28
11
  if(user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!")
29
12
 
@@ -43,109 +26,12 @@ module.exports = {
43
26
  if(e.response.data == -1) throw new Error("-1 Not found.");
44
27
  throw new Error(e.response.data);
45
28
  })
46
-
47
- let firstComment = res.data;
48
- let secondComment;
49
- let thirdComment;
50
- let fourthComment;
51
- let fifthComment;
52
- let sixthComment;
53
- let seventhComment;
54
- let eighthComment;
55
- let ninthComment;
56
- let tenthComment;
57
-
58
- let result = [decCommentFromHistory(firstComment)]
59
-
60
- if(res.data.split("|").length - 1 == 1) {
61
- firstComment = res.data.split("|")[0];
62
- secondComment = res.data.split("|")[1].split("|")[0];
63
- result.push(decCommentFromHistory(secondComment))
64
- }
65
-
66
- if(res.data.split("|").length - 1 == 2) {
67
- firstComment = res.data.split("|")[0];
68
- secondComment = res.data.split("|")[1].split("|")[0];
69
- thirdComment = res.data.split("|")[2].split("|")[0];
70
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment))
71
- }
72
-
73
- if(res.data.split("|").length - 1 == 3) {
74
- firstComment = res.data.split("|")[0];
75
- secondComment = res.data.split("|")[1].split("|")[0];
76
- thirdComment = res.data.split("|")[2].split("|")[0];
77
- fourthComment = res.data.split("|")[3].split("|")[0];
78
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment))
79
- }
80
-
81
- if(res.data.split("|").length - 1 == 4) {
82
- firstComment = res.data.split("|")[0];
83
- secondComment = res.data.split("|")[1].split("|")[0];
84
- thirdComment = res.data.split("|")[2].split("|")[0];
85
- fourthComment = res.data.split("|")[3].split("|")[0];
86
- fifthComment = res.data.split("|")[4].split("|")[0];
87
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment))
88
- }
89
-
90
- if(res.data.split("|").length - 1 == 5) {
91
- firstComment = res.data.split("|")[0];
92
- secondComment = res.data.split("|")[1].split("|")[0];
93
- thirdComment = res.data.split("|")[2].split("|")[0];
94
- fourthComment = res.data.split("|")[3].split("|")[0];
95
- fifthComment = res.data.split("|")[4].split("|")[0];
96
- sixthComment = res.data.split("|")[5].split("|")[0];
97
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment))
98
- }
99
-
100
- if(res.data.split("|").length - 1 == 6) {
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
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment))
109
- }
110
-
111
- if(res.data.split("|").length - 1 == 7) {
112
- firstComment = res.data.split("|")[0];
113
- secondComment = res.data.split("|")[1].split("|")[0];
114
- thirdComment = res.data.split("|")[2].split("|")[0];
115
- fourthComment = res.data.split("|")[3].split("|")[0];
116
- fifthComment = res.data.split("|")[4].split("|")[0];
117
- sixthComment = res.data.split("|")[5].split("|")[0];
118
- seventhComment = res.data.split("|")[6].split("|")[0];
119
- eighthComment = res.data.split("|")[7].split("|")[0];
120
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment))
121
- }
122
-
123
- if(res.data.split("|").length - 1 == 8) {
124
- firstComment = res.data.split("|")[0];
125
- secondComment = res.data.split("|")[1].split("|")[0];
126
- thirdComment = res.data.split("|")[2].split("|")[0];
127
- fourthComment = res.data.split("|")[3].split("|")[0];
128
- fifthComment = res.data.split("|")[4].split("|")[0];
129
- sixthComment = res.data.split("|")[5].split("|")[0];
130
- seventhComment = res.data.split("|")[6].split("|")[0];
131
- eighthComment = res.data.split("|")[7].split("|")[0];
132
- ninthComment = res.data.split("|")[8].split("|")[0];
133
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment),decCommentFromHistory(ninthComment))
134
- }
135
-
136
- if(res.data.split("|").length - 1 == 9) {
137
- firstComment = res.data.split("|")[0];
138
- secondComment = res.data.split("|")[1].split("|")[0];
139
- thirdComment = res.data.split("|")[2].split("|")[0];
140
- fourthComment = res.data.split("|")[3].split("|")[0];
141
- fifthComment = res.data.split("|")[4].split("|")[0];
142
- sixthComment = res.data.split("|")[5].split("|")[0];
143
- seventhComment = res.data.split("|")[6].split("|")[0];
144
- eighthComment = res.data.split("|")[7].split("|")[0];
145
- ninthComment = res.data.split("|")[8].split("|")[0];
146
- tenthComment = res.data.split("|")[9].split("|")[0];
147
- result.push(decCommentFromHistory(secondComment),decCommentFromHistory(thirdComment),decCommentFromHistory(fourthComment),decCommentFromHistory(fifthComment),decCommentFromHistory(sixthComment),decCommentFromHistory(seventhComment),decCommentFromHistory(eighthComment),decCommentFromHistory(ninthComment),decCommentFromHistory(tenthComment))
148
- }
29
+
30
+ let comments = res.data.split("|");
31
+ let result = [];
32
+ comments.forEach(c => {
33
+ result.push(decCommentFromHistory(c));
34
+ })
149
35
 
150
36
  return result;
151
37
  }