Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How come this match to HTML didn't work?

I found this old question that Ayonjun answered, and it had this neat function that got the amount of people in a group using HTTPService and GetAsync. I tried to do this, but instead with the group owner. It returned a nil value...

function getGroupOwner(groupId) -- returns the group size
    local groupLink = "http://www.rproxy.pw/My/Groups.aspx?gid=" .. groupId
    local html = game:GetService("HttpService"):GetAsync(groupLink, true)
    pattern = [[Owned By: <a style="font-style: italic;" href="../user.aspx?id=%d+"]]
	local ownerName = html:match(pattern):gmatch("%d+")
    return ownerName
end

1 answer

✓ Accepted answer

Why HttpService? Keep things simple, use GroupService.

groupstuff = game:GetService("GroupService"):GetGroupInfoAsync(372) --Get a table of the group info

function RecursivePairs(t) -- I did this because there's tables within the group info.
	for key, value in pairs(t) do
		if type(value) == "table" then
			RecursivePairs(value)
		else
			print(key..":\n\n"..value.."\n")
		end
	end
end

RecursivePairs(groupstuff)

This discussion is preserved as it was. New answers, comments, and votes are closed.