How to get a Devforum post using HttpService?

Hello!

An idea has hit me to use HttpService since it makes me a pro scripter… jk. Basically, want I am trying to achieve is to load a page from a devforum.roblox.com domain (specifically this page) and use this data to build in-game changelogs frame automatically. However, there are numerous issues regarding it:

First issue: AFAIA, there is no API for devforum available, meaning it’s impossible to load pages “legally”. If you are somehow aware of its existance, please let me know

Second issue: HttpService actually prohibits to use it for Roblox-related endpoints by throwing HttpService is not allowed to access ROBLOX resources error, which is a shame to be honest. Example:

local HttpService = game:GetService('HttpService')

local success, gameData = pcall(function()
	return HttpService:JSONDecode(HttpService:RequestAsync({
		Url = 'https://games.roblox.com/v1/games?universeIds=3317771874',
		Method = 'GET'
	}).Body).data[1]
end)

if not success then
	warn(`Error getting data: {gameData}`)
else
	print(`Our beloved has {gameData.visits} vists and {gameData.playing} players are developing ........ addiction`)
end
-- Output: Error getting data: HttpService is not allowed to access ROBLOX resources

Don’t take it seriously please. Solution? A bunch of people found a bypass by just using a proxy, and some actually made proxies specifically for this, the most famous probably being RoProxy. If we just replace Url to https://games.roproxy.com/v1/games?universeIds=3317771874 it will work
However, I still couldn’t figure out how to use this proxy for devforum, because it clrearly works in the browser (no proxy and RoProxy) but HttpService throws HttpError: InvalidRedirect error

Any help is appreciated

1 Like

The Developer Forum implements a human verification step in high-traffic situations, so this might not work 100% of the time, which is what is likely causing the issue.

Discourse (devforum software) implements an API you can access the docs to here, if you want to access the metadata of a post, just add .json to the end of the topic id, for example, this post

I might seem to not understand this since I am not a web developer. Does this mean I have to set up my own server?

Edit: I think I got it. At least I achieved what I wanted. Thanks!

In the docs I found about https://{host}/posts/{id}.json which is excactly what I wanted and it works just fine with the RoProxy and doesn’t require any authentication.

Those who are wondering how I did it, I will try to explain it. You need to get the post id. I assume it’s pretty much hidden and to get it you need to go to the .json version of a topic in question (just add .json to the end of URL). Then you will need to find a post in post_stream.posts array and get the id from there.

For example, if you go to How to get a Devforum post using HttpService? (which is the topic you are currently reading) and if you want the first post, its id is 10332815. Using this id, we can make something like this in a script:

local POST_ID = 10332815
local HttpService = game:GetService('HttpService')

local success, data = pcall(function()
	return HttpService:JSONDecode(HttpService:RequestAsync({
		Url = `https://devforum.roproxy.com/posts/{POST_ID}.json`,
		Method = 'GET'
	}).Body).raw
end)

if not success then
	warn(`Error getting data: {data}`)
else
	print(data)
end

data is a text of a topic. In this case - it’s my first post here.

Hope I haven’t said anything wrong :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.