As you may be aware, I created the neat little online badge things for people's signatures. Doing this was a bit tricky due to the fact that the only place I could find a list of online players was on the HC homepage. My program had to download the entire homepage every single time an online status badge was requested to check whether the player was online or not. (There have been over 160,000 requests since July 11. Each request downloads about 20kb, so if my math is correct that's around 3GB total).
Around August 4th, the way the list of currently online players was displayed on the homepage changed, breaking my widget. I could slightly modify my code and have it work again, but I think I have a better solution that would not only help me, but would put less stain on the herocraftonline.com server as well as allow others to easily access this information.
To get to the point, I was wondering if it would be possible to serve a JSON file containing the list of online players. It would basically look something like this:
To go a step further, additional data could be served via this JSON file, enabling somepretty extremely cool things. For example, you could include players' classes, levels, the current world time, etc.
By publishing data like this, so many doors would be opened. People could display their levels, achievements, etc. anywhere. It would be one step further in the integration of Herocraft and the web. (Also, this entire JSON file would only be 0.5kb. That's 1/40th the original size and 100x as much useful information.)
I'm sure this doesn't mean much to most of you, but it's pretty exciting to me. I'm weird, I guess. I hope you consider my suggestion though nonetheless. (I also apologize for how horribly I typed this out. It's 1:30AM and I'm half asleep.)
Around August 4th, the way the list of currently online players was displayed on the homepage changed, breaking my widget. I could slightly modify my code and have it work again, but I think I have a better solution that would not only help me, but would put less stain on the herocraftonline.com server as well as allow others to easily access this information.
To get to the point, I was wondering if it would be possible to serve a JSON file containing the list of online players. It would basically look something like this:
Code:
{
"onlinePlayers" : ["player1", "player2", "etc"]
}
To go a step further, additional data could be served via this JSON file, enabling some
Code:
{
"onlinePlayers" : {
"player1" : {
"class" : {
"main" : ["ranger", 11],
"profession" : ["engineer", 23]
},
"titles" : {
"prefix" : ["failure", "veteran", "rogue", "crafter"],
"suffix" : ["t1star", "t2star", "t3star"]
}
},
"player2" : {
"class" : {
"main" : ["lostsoul", 1]
}
},
"player3" : {
"class" : {
"main" : ["dragoon", 60],
"profession" : ["alchemist", 55]
},
"titles" : {
"prefix" : ["warrior", "dragoon", "crafter", "alchemist"]
}
}
},
"worlds" : {
"Dragon" : {
"time" : "23:11",
"weather" : "rain"
},
"Warshard" : {
"time" : "05:11",
"weather" : "sun"
}
},
"lottery" : {
"countdown" : "82808763",
"pot" : "6592"
},
"bounty" : {
"bounties" : [["player1", "890.00"], ["player3", "95.00"]]
}
}
By publishing data like this, so many doors would be opened. People could display their levels, achievements, etc. anywhere. It would be one step further in the integration of Herocraft and the web. (Also, this entire JSON file would only be 0.5kb. That's 1/40th the original size and 100x as much useful information.)
I'm sure this doesn't mean much to most of you, but it's pretty exciting to me. I'm weird, I guess. I hope you consider my suggestion though nonetheless. (I also apologize for how horribly I typed this out. It's 1:30AM and I'm half asleep.)