A Working PHP Server Query

Status
This thread has been locked.

jacobsscoots

Feedback score
0
Posts
113
Reactions
17
Resources
0
Hi there,

I'm looking for a working server query for Minecraft so I can display how many people are playing a server on a website.

Kind of like this:
Delete.png


Please help me if you have any that are up to date or working. I'm not paying since there are free ones on google except they're out of date.

Thanks, Jacob
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Christopher

Floating around
Supreme
Feedback score
8
Posts
2,048
Reactions
1,120
Resources
0
Hi there,

I'm looking for a working server query for Minecraft so I can display how many people are playing a server on a website.

Kind of like this:
Delete.png


Please help me if you have any that are up to date or working. I'm not paying since there are free ones on google except they're out of date.

Thanks, Jacob
PM me, I have one right here ;)
 

Chearful

thomas.gg
Supreme
Feedback score
115
Posts
1,398
Reactions
2,236
Resources
0
chrome_2016-07-14_18-40-30.png
 

Guusz

Full-Stack Web Developer
Premium
Feedback score
0
Posts
248
Reactions
138
Resources
0
I have used it before.
For educational purposes, its ok.
But for productional purposes it sucks, because after a few times of requesting, you just get a message saying you can only do it in a certain amount of time.
 

Chearful

thomas.gg
Supreme
Feedback score
115
Posts
1,398
Reactions
2,236
Resources
0
Im not that good with PHP, so how would I do this?
Query the api, then use json_decode[DOUBLEPOST=1468518162][/DOUBLEPOST]
I have used it before.
For educational purposes, its ok.
But for productional purposes it sucks, because after a few times of requesting, you just get a message saying you can only do it in a certain amount of time.
Cache the requests.
 

Guusz

Full-Stack Web Developer
Premium
Feedback score
0
Posts
248
Reactions
138
Resources
0
Try to make one request once very few minutes, because if you perform too many at one time then your very likely to timeout or get denied by the website.
Yeah, I didn't come up with this idea last night when I was coding one of those systems. Thanks for the idea. :)
 

Christopher

Floating around
Supreme
Feedback score
8
Posts
2,048
Reactions
1,120
Resources
0
Don't worry guys, I have helped him ;)
 

Christopher

Floating around
Supreme
Feedback score
8
Posts
2,048
Reactions
1,120
Resources
0

Guusz

Full-Stack Web Developer
Premium
Feedback score
0
Posts
248
Reactions
138
Resources
0
Use this:
https://github.com/xPaw/PHP-Minecraft-Query

Then, on your index page, use AJAX to fetch the player count. Using AJAX, you can have faster page load times, as well as having the player count update every X seconds without the user needing to refresh the page.
That would work, though you need to fill in the IP, you cant use any SRV. I looked through it today and noticed that someone made an issue about that. He made a fork of it and included a fix for that in there.

EDIT: https://github.com/games647/PHP-Minecraft-Query
 

Guusz

Full-Stack Web Developer
Premium
Feedback score
0
Posts
248
Reactions
138
Resources
0
Isn't there a way to figure this out using Node JS instead of PHP?
Node JS would require a server running 24/7, I think using a MySQL database and getting the online players via that database would be most efficient, or using the github repo I just posted.
 
Status
This thread has been locked.
Top