Improve this

This commit is contained in:
Lncvrt committed 2026-02-21 12:56:47 -07:00
1 parent 0efb404a01
commit 727208abd7
4 files changed
+66 -17

No files matched your search

+28 -3
View File
@@ -136,6 +136,12 @@ app.get('/comments/account', handler => commentsAccountGetHandler(handler), {
description: description:
'The page you want to get, starts from `0`. Default is `0`.' 'The page you want to get, starts from `0`. Default is `0`.'
}) })
),
amount: t.Optional(
t.String({
description:
'The amount of comments you want to get. Default is `10`. Range is `1`-`100`.'
})
) )
}) })
}) })
@@ -154,6 +160,17 @@ app.get(
description: description:
'The page you want to get, starts from `0`. Default is `0`.' 'The page you want to get, starts from `0`. Default is `0`.'
}) })
),
amount: t.Optional(
t.String({
description:
'The amount of comments you want to get. Default is `10`. Range is `1`-`100`.'
})
),
mode: t.Optional(
t.Union([t.Literal('recent'), t.Literal('top')], {
description: 'Default is `recent`.'
})
) )
}) })
} }
@@ -171,9 +188,17 @@ app.get('/comments/level', handler => commentsLevelGetHandler(handler), {
'The page you want to get, starts from `0`. Default is `0`.' 'The page you want to get, starts from `0`. Default is `0`.'
}) })
), ),
mode: t.Union([t.Literal('0'), t.Literal('1')], { amount: t.Optional(
description: '0 for top, 1 for recent' t.String({
}) description:
'The amount of comments you want to get. Default is `10`. Range is `1`-`100`.'
})
),
mode: t.Optional(
t.Union([t.Literal('recent'), t.Literal('top')], {
description: 'Default is `recent`.'
})
)
}) })
}) })
app.get( app.get(
+11 -2
View File
@@ -5,6 +5,7 @@ import { Context } from 'elysia'
export const handler = async (handler: Context) => { export const handler = async (handler: Context) => {
const id = handler.query.id const id = handler.query.id
const page = handler.query.page const page = handler.query.page
const amount = handler.query.amount
const request = await axios.post( const request = await axios.post(
'https://www.boomlings.com/database/getGJAccountComments20.php', 'https://www.boomlings.com/database/getGJAccountComments20.php',
@@ -13,6 +14,7 @@ export const handler = async (handler: Context) => {
binaryVersion: '45', binaryVersion: '45',
accountID: id, accountID: id,
page: page ?? '0', page: page ?? '0',
count: amount ?? '10',
secret: 'Wmfd2893gb7' secret: 'Wmfd2893gb7'
}), }),
{ {
@@ -33,12 +35,19 @@ export const handler = async (handler: Context) => {
responseSplit.map(item => { responseSplit.map(item => {
const commentInfo = item[0] const commentInfo = item[0]
return { const data = {
id: +commentInfo['6'], id: +commentInfo['6'],
content: atob(commentInfo['2']), content: commentInfo['2'],
decodeFailed: false,
likes: +commentInfo['4'], likes: +commentInfo['4'],
date: commentInfo['9'] + ' ago' date: commentInfo['9'] + ' ago'
} }
try {
data.content = atob(data.content)
} catch {
data.decodeFailed = true
}
return data
}) })
) )
} }
+14 -4
View File
@@ -5,6 +5,8 @@ import { Context } from 'elysia'
export const handler = async (handler: Context) => { export const handler = async (handler: Context) => {
const id = handler.query.id const id = handler.query.id
const page = handler.query.page const page = handler.query.page
const mode = handler.query.mode
const amount = handler.query.amount
const request = await axios.post( const request = await axios.post(
'https://www.boomlings.com/database/getGJCommentHistory.php', 'https://www.boomlings.com/database/getGJCommentHistory.php',
@@ -13,8 +15,9 @@ export const handler = async (handler: Context) => {
binaryVersion: '45', binaryVersion: '45',
page: page ?? '0', page: page ?? '0',
secret: 'Wmfd2893gb7', secret: 'Wmfd2893gb7',
mode: '1', mode: mode ? (mode == 'recent' ? '0' : '1') : '0', //Don't worry about it
userID: id userID: id,
count: amount ?? '10'
}), }),
{ {
headers: { headers: {
@@ -35,10 +38,11 @@ export const handler = async (handler: Context) => {
const commentInfo = item[0] const commentInfo = item[0]
const accountInfo = item[1] const accountInfo = item[1]
return { const data = {
id: +commentInfo['6'], id: +commentInfo['6'],
levelId: +commentInfo['1'], levelId: +commentInfo['1'],
content: atob(commentInfo['2']), content: commentInfo['2'],
decodeFailed: false,
likes: +commentInfo['4'], likes: +commentInfo['4'],
date: commentInfo['9'] + ' ago', date: commentInfo['9'] + ' ago',
commentColor: commentInfo['12'] commentColor: commentInfo['12']
@@ -61,6 +65,12 @@ export const handler = async (handler: Context) => {
} }
} }
} }
try {
data.content = atob(data.content)
} catch {
data.decodeFailed = true
}
return data
}) })
) )
} }
+13 -8
View File
@@ -6,21 +6,19 @@ export const handler = async (handler: Context) => {
const id = handler.query.id const id = handler.query.id
const page = handler.query.page const page = handler.query.page
const mode = handler.query.mode const mode = handler.query.mode
const amount = handler.query.amount
const request = await axios.post( const request = await axios.post(
'https://www.boomlings.com/database/getGJComments21.php', 'https://www.boomlings.com/database/getGJComments21.php',
new URLSearchParams({ new URLSearchParams({
gameVersion: '22', gameVersion: '22',
binaryVersion: '45', binaryVersion: '45',
udid: 'BEA53432-326F-4D39-91D7-2B51B849825E',
uuid: '241138636',
accountID: '28945106',
gjp2: '836845372d7a726b35f627bcc491d4e122782c17',
page: page ?? '0', page: page ?? '0',
total: '0', total: '0',
secret: 'Wmfd2893gb7', secret: 'Wmfd2893gb7',
mode, mode: mode ? (mode == 'recent' ? '0' : '1') : '0', //Don't worry about it
levelID: id levelID: id,
count: amount ?? '10'
}), }),
{ {
headers: { headers: {
@@ -41,9 +39,10 @@ export const handler = async (handler: Context) => {
const commentInfo = item[0] const commentInfo = item[0]
const accountInfo = item[1] const accountInfo = item[1]
return { const data = {
id: +commentInfo['6'], id: +commentInfo['6'],
content: atob(commentInfo['2']), content: commentInfo['2'],
decodeFailed: false,
likes: +commentInfo['4'], likes: +commentInfo['4'],
date: commentInfo['9'] + ' ago', date: commentInfo['9'] + ' ago',
commentColor: commentInfo['12'] commentColor: commentInfo['12']
@@ -66,6 +65,12 @@ export const handler = async (handler: Context) => {
} }
} }
} }
try {
data.content = atob(data.content)
} catch {
data.decodeFailed = true
}
return data
}) })
) )
} }