I've been looking all over the net, found tons of stuff, but I can't put 2+2 together for some reason. I can't find any tutorials or examples that perfectly fit with what I'm trying to do. I've never used jQuery, or created anything really from nothing. I usually use things like wordpress or joomla and edit from there, most of which makes sense to me by just reading the code. I guess I understand PHP more than javascript. This time I'm not using PHP, just plain html. However if I need to I can use whatever, just I can't find anything useful.
I want to create a static web page on my server and create a table of information, the source being the JSON files that minecraft servers create.
Example:
ADMINS:(loaded from ops.json)
Name1
Name2
Name3
Whitelisted Players: (Loaded from whitelist.json)
Name1
Name2
Name3
Then what I would really want would be a second page with statistics:
Start Table
Name:(whitelist.json) | Mob Kills (uuid from whitelist name = world\stats\uuid.JSON has the info) | Time Played | Damage Dealt
Name1 | 100 | 247 | 20000
Name2 | 1 | 60 | 20
Most of the stuff I've looked up their JSON isn't formatted the same way that MC's is. All the examples I've seen the Array is named and then that name is used through out the code, MC doesn't name the array since the entire file is one large array. Then the next question would be if it was possible to pull a file, from the info in another file like I referenced?
Why do I want to do this? So I can create the pages without manually editing the page, it will basically self maintain by me editing the JSON files with ingame commands.
forgot to mention webpage will be hosted on the same server so it's local files.
This time I'm not using PHP, just plain html. However if I need to I can use whatever, just I can't find anything useful.
Most of the stuff I've looked up their JSON isn't formatted the same way that MC's is. All the examples I've seen the Array is named and then that name is used through out the code, MC doesn't name the array since the entire file is one large array. Then the next question would be if it was possible to pull a file, from the info in another file like I referenced?
I'm not really sure how you would do it with just HTML, but here is some PHP to help (if I understand your issue correctly).
This will load the .JSON file, then convert it into an array that you can use.
Above a solution was posted with PHP, but if you don't want to deal with server sided code you can use JavaScript. jQuery will come in handy for this. Use this (http://api.jquery.com/jquery.getjson/) to create the JSON object and then use a for loop like so:
(var i = 0; i < jsonItems.length; i++) {console.log(jsonItems[i].name);
console.log(jsonItems[i].uuid);
}
I want to create a static web page on my server and create a table of information, the source being the JSON files that minecraft servers create.
Example:
ADMINS:(loaded from ops.json)
Then what I would really want would be a second page with statistics:
Start Table
Name:(whitelist.json) | Mob Kills (uuid from whitelist name = world\stats\uuid.JSON has the info) | Time Played | Damage Dealt
Name1 | 100 | 247 | 20000
Name2 | 1 | 60 | 20
Most of the stuff I've looked up their JSON isn't formatted the same way that MC's is. All the examples I've seen the Array is named and then that name is used through out the code, MC doesn't name the array since the entire file is one large array. Then the next question would be if it was possible to pull a file, from the info in another file like I referenced?
Why do I want to do this? So I can create the pages without manually editing the page, it will basically self maintain by me editing the JSON files with ingame commands.
forgot to mention webpage will be hosted on the same server so it's local files.
I'm not really sure how you would do it with just HTML, but here is some PHP to help (if I understand your issue correctly).
This will load the .JSON file, then convert it into an array that you can use.
No problem. If you need any help feel free to send me a PM!