Live group member count

hello. i saw a few other posts but none of them worked,
for example with this one;

GroupId = 184949932276
Members = game.HttpService:JSONEncode(HttpProxy:GetAsync("https://groups.roblox.com/v1/groups/" .. tostring(GroupId))).memberCount

the problem was that the “HttpProxy” is underlined orange.
please help!

4 Likes

I made a post on how to make your own proxy in about 10 minutes so if you follow that then all you would need to do is

local https = game:GetService('HttpService')

local ProxyUrl = "ProxyNameHere".."?link="

local GroupId = groupId

local Url = "groups.roblox.com/v1/groups/"..GroupId

local EncodedUrl = https:UrlEncode(Url)

local Response = https:GetAsync(ProxyUrl..EncodedUrl)
Response = https:JSONDecode(Response)

local MemberCount = Response.memberCount

print(MemberCount)

Then just wrap that in a while loop for every 30 seconds? (because of rate limits)

3 Likes

HOW WOULD I DO THAT using rproxy.xyz?

3 Likes

i think it would be

local https = game:GetService('HttpService')


local GroupId = groupId

local Url = "https://groups.roproxy.com/v1/groups/"..GroupId


local Response = https:GetAsync(Url)
Response = https:JSONDecode(Response)

local MemberCount = Response.memberCount

print(MemberCount)
1 Like

also… i just set up my own proxy but it always returns nil
mind having a look at it?

2 Likes

sure is this the one in the post I made or a different one?

2 Likes

its the post from… one second…

he shows everything,… i did what he said and set up my own proxy… heres the module:

--Original code by Brad_Sharp, modified by FromLegoUniverse

--The variable below is the ID of the script you've created, you won't need
--to enter any information other than this.

local ScriptId = "AKfycbytIC5S0IOSjeFL_qaGccxvTAjkE87ZSGgUziR23EMo0xMzUOEWcBml0JqJYzoqj_V5Kg"

--Only modify below if you know what you are doing.

local Url = "https://script.google.com/macros/s/" .. ScriptId .. "/exec"
local HttpService = game:GetService'HttpService'
local Module = {}


function JSONDecode(JSON)
	local JSONTable = {} 
	pcall(function ()
		JSONTable = HttpService:JSONDecode(JSON)
	end) 
	return JSONTable
end


function Module:GetAsync(Link)
	local JSON = HttpService:GetAsync(Url .. "?q="..game.HttpService:UrlEncode(Link))
	local Result = JSONDecode(JSON)
	if Result.result == "success" then
		return Result.response
	else
		warn(tostring(Link).." failed to fetch because "..tostring(Result.error))
		return
	end
end

return Module

and heres the code of the script requiring it:

local HttpProxy = require(game.Workspace.HttpProxyService:Clone()) --Requires the module. Location will vary by where you place it

GroupId = 184949932276
Members = game.HttpService:JSONEncode(HttpProxy:GetAsync("https://groups.roblox.com/v1/groups/" .. tostring(GroupId))).memberCount

what it prints? nil

3 Likes

I just ran this bit (which by the way doesn’t use the module) and it worked fine

image

2 Likes

UMMM OOPS I MEANT THIS IS THE CODE REQUIRING THE MODULE… sorry

local HttpProxy = require(game.Workspace.HttpProxyService:Clone()) --Requires the module. Location will vary by where you place it

GroupId = 184949932276
Members = game.HttpService:JSONEncode(HttpProxy:GetAsync("https://groups.roblox.com/v1/groups/" .. tostring(GroupId))).memberCount
1 Like

I can’t view the code in that proxy right now so I have no way of telling what it’s doing

2 Likes

I would suggest making either your own through a different method or using roproxy

2 Likes

ok i will do that. i am using the code from the turorial that i mentioned, so you can actually read the java code.

heres the proxy java code!

function doGet(e) {
  var output;
  try
  {
    var query = e.parameter["q"];
    var response = UrlFetchApp.fetch(decodeURIComponent(query));
    output = {"result":"success", "response": JSON.parse(response.getContentText())};
  }
  catch(e)
  {
    output = {"result":"error", "error": "Unable to fetch"};
  }
  return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);
}
1 Like

umm to be honest I don’t really know how that google scripts work and what packages they use. I am only good with express.js however it does look like it should be working

try replacing the bit "result": "error" with "result: e

1 Like

CAN YOU DO IT FOR ME ?? i dont know what you are talking about

1 Like

wait what why would you do that, its meant to be like tht

1 Like

It’s so it can show the error.

function doGet(e) {
  var output;
  try
  {
    var query = e.parameter["q"];
    var response = UrlFetchApp.fetch(decodeURIComponent(query));
    output = {"result":"success", "response": JSON.parse(response.getContentText())};
  }
  catch(e)
  {
    output = {"result": e, "error": "Unable to fetch"};
  }
  return ContentService.createTextOutput(JSON.stringify(output)).setMimeType(ContentService.MimeType.JSON);
}

This would be the code

it still doesnt work and i dont know why

It’s just for debugging that’s all

still prints nil … ): i dont know whats wrong

Ye I don’t really know with this one. try using roproxy or make one on glitch.com