Jump to content
  • 0

Servers Stats on other website


Vyorel

Question

8 answers to this question

Recommended Posts

  • 0

Vyorel:

 

basicly what you can do is get the content of http://api.ets2mp.com/servers/somehow and dump that into a variable(I'm using curl for this below, but any other way is possible too)

$curl_handle = curl_init();$url = "http://api.ets2mp.com/servers/";curl_setopt($curl_handle, CURLOPT_URL, $url);curl_setopt($curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);$response = curl_exec($curl_handle); $jsonobj = json_decode($response); echo $jsonobj->0->{'players'}; //will get you the current player count.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.