ID:166586
 
If so, what variable?

Thanks.
No, but with world.Export() you can achieve getting it. I have something like that in Paint, here is a snippet:

var/rank
world/New()
var/http[]=world.Export("http://games.byond.com/hub/XxDohxX/Paint;format=text")
if(http)
var/X=http["CONTENT"]
if(X)
var/text = file2text(X)
rank = copytext(text,findtext(text,"byond_rank = "),findtext(text,"status"))
rank = dd_replacetext(rank,"byond_rank = ","")
rank = text2num(rank)



Of course you would have to change, XxDohxX/Paint. Hope that helps.
-Doh
In response to XxDohxX
XxDohxX wrote:
> var/rank
> world/New()
> var/http[]=world.Export("http://games.byond.com/hub/XxDohxX/Paint;format=text")
> if(http)
> var/X=http["CONTENT"]
> if(X)
> var/text = file2text(X)
> rank = copytext(text,findtext(text,"byond_rank = "),findtext(text,"status"))
> rank = dd_replacetext(rank,"byond_rank = ","")
> rank = text2num(rank)


The copy/find/replacetext method is prone to error if the line ordering ever changes. It also requires an external library (though a quite good one!). The hub text format is already a savefile, so simply treat it as such:

#define BYONDHUB "http://www.byond.com/hub/"
proc/GetHubRank(game)
var/http[] = world.Export("[BYONDHUB][game];format=text")
var/result = http["CONTENT"]
if (result)
var/rank
var/savefile/s = new
s.ImportText("/", file2text(result))
s["/general/byond_rank"] >> rank
return rank

mob/verb/getrank(game as text)
src << "Rank for [game]: [GetHubRank(game)]
In response to Mike H
Thanks a ton, guys.