As the tittle suggest, “how would I get a user’s role on the Forum”?
I’ve looked it up and nothing has seemed to work.
I’ve looked it up and nothing has seemed to work.
I meant script wise, I want it to return the Player’s trust level!
This seems to be the best one:
However it’s returning my Trust Level as ‘none’
You can do some web scraping by getting the page and then look for:
<dd class="trust-level">Member</dd>
I am not sure, but it seems like this information is embedded within the page directly.
Actually, the approach you mentioned seems much more clean. It appears that you can find the “trust_level” field and then work out what its level stands for.
"trust_level":1
This should work, since I get a valid JSON with a "trust_level":1
with your name.
These are deprecated I think, cause they do not exist. This is why you got ‘none’ as a return value.
Oh boy here we go.
-- Data:
local User = ""
local TrustLevels = {
["1"] = "Member",
["2"] = "Regular",
-- and so on
}
-- Variables:
local HttpService = game:GetService("HttpService")
local Json = HttpService:GetAsync("https://devforum.roblox.com/u/" .. User ..".json")
local ForumData = HttpService:JSONDecode(Json)
-- Utilities:
local function convertTrustLevel(number)
if number == 1 then
print("Member")
elseif number == 2 then
print("Regular")
end
end
-- Main Code:
local TrustLevelNumber = tonumber(ForumData.user.trust_level)
-- Post Setups:
convertTrustLevel(TrustLevelNumber)
convertTrustLevel()
function.Also I’d suggest you to use a Chrome Extension called Json Parser since its way easier to see all the data.
Is it not illegal? since you can’t get any roblox website from HTTPs service?
No its not illegal since anyone can do this. If it was illegal information would be encrypted, and the fact that you can just do this right now makes it legal + that its public information mostly.
Alright, can I get discord name too?
Alrighty thank you so much.
Can I get discord name too? I know that’s @ItsPlasmaRBLX post but I just ask because it’s interesting.
Seems like I’m getting an error
Yeah, they got rid of the groups so that people wouldn’t sort by the group’s recently added in an attempt to game the (TL2) requirements. They’re not deprecated, they’re fully gone.
You have to use a proxy because Roblox servers’ IPs are given access to internal APIs for CoreScripts to be able to add friends/followers/make purchases (and so on) from ingame. Developers can’t force these requests for obvious reasons. As long as you do it from your own server, you are allowed (and encouraged) to use any Roblox web APIs.
I don’t think OP ever got an answer to their question, but you can use rprxy for this as well if you don’t have your own proxy server.
local HttpService = game:GetService("HttpService")
local function get_trust_level(user: string): number
local info = HttpService:RequestAsync({
Url = string.format("https://devforum.rprxy.xyz/u/%s.json", user),
Method = "GET",
})
if info.Success then
return HttpService:JSONDecode(info.Body).user.trust_level
end
return -1 -- failed somehow
end