Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.19 17:42:00 -
[1]
How do i pull the server status for Tranquility and SISI so i can make a web page showing the current time status and players ?
|

Kravek
Lamb Federation Navy C0VEN
|
Posted - 2009.10.19 18:04:00 -
[2]
Use this: http://wiki.eve-id.net/APIv2_Server_ServerStatus_XML
|

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 06:45:00 -
[3]
Edited by: Commander Ventura on 20/10/2009 06:47:50 ok i have tried this but when i copy it it to an xml document it wont refresh when i host it. i oped this page to get it http://api.eve-online.com/server/ServerStatus.xml.aspx
|

Arous Drephius
|
Posted - 2009.10.20 06:48:00 -
[4]
Originally by: Commander Ventura ok i have tried this but when i copy it it to an xml document it wont refresh when i host it.
What? You do know that you have to read that XML from the API server within your PHP script right?
|

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 06:57:00 -
[5]
yes but thats what i am asking does anyone have a script i can use to learn how to
|

Sleepkevert
Amarr Rionnag Alba Against ALL Authorities
|
Posted - 2009.10.20 09:13:00 -
[6]
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers); In it's simplest of ways. It isn't very nice though since you do 0 local caching, especially if the page is loaded a lot it will be hammering the CCP servers. Best to check the cacheduntill time to your time on a locally saved copy, and fetch a new one when expired. This will also slow down every pageload since you'll be fetching something from the CCP servers before the page can actually be sent to the client. _
Add your own line! |

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 10:21:00 -
[7]
yeah but is there a simple php code that shows the Status and players ?
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 11:28:00 -
[8]
This IS the simpliest code snip
Originally by: Sleepkevert
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
As you do not know what that means, I presume you don't know what PHP is and just heard from a friend that it's cool.
But this board is for people looking for help, so what excactly do you plan? Maybe we can help you with that or talk you out of it 
|

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 12:34:00 -
[9]
Edited by: Commander Ventura on 20/10/2009 12:37:04 Edited by: Commander Ventura on 20/10/2009 12:36:19 it would be cool if you could show me how to, i have ony ever done HTML php is quite new. i have uploaded a copy to a server for you to see what i get.
http://www.uk-time.co.cc/api/API.xml
if it does not work copy and paste this into your browser adress bar
http://www.uk-time.co.cc/api/API.xml
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 13:02:00 -
[10]
Well, well ... where to start ....
First, you are doing it totally wrong :)
You tried to put PHP code into an XML. That will never work because the web server will say "oh, it's an XML, so I read it from the disc and send it to the user". It will not interpret the code within!
If your web server is configured to interpret php (afaik default to apache or tomcat), the server will work with this:
Create a file named "test.html"
<html>
<body>
Players:
<?
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
?> </body> </html>
The code between <? and ?> is then "compiled" and executed on the server, if you request the file. If you call e.g. http://localhost/test.html, the result should be Players: 12345 .
I may haved missed something, because I wrote this without any test. But any further info should be found on Google with "php turorial" :-)
|
|

ingenting
20th Legion Sodalitas XX
|
Posted - 2009.10.20 13:03:00 -
[11]
Edited by: ingenting on 20/10/2009 13:03:52 Edited by: ingenting on 20/10/2009 13:03:38
Originally by: Commander Ventura url="null"
ofc it doesnt work when u didnt enter the URL....
|

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 13:34:00 -
[12]
Edited by: Commander Ventura on 20/10/2009 13:37:17 ok i did that it worked first time but not the second time =(
http://www.uk-time.co.cc/api/test.html
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 13:48:00 -
[13]
Originally by: Commander Ventura Edited by: Commander Ventura on 20/10/2009 13:37:17 ok i did that it worked first time but not the second time =(
http://www.uk-time.co.cc/api/test.html
Hmmm... I get "Players:24120" and after several reloads "Players:24296"
I think it works! 
|

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.20 14:02:00 -
[14]
oh sorry it is working now i left it a bit ans its settled down
|

Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2009.10.21 04:56:00 -
[15]
Edited by: Johnathan Roark on 21/10/2009 04:57:30
Originally by: Lutz Major
Create a file named "test.html"
Don't do that, use test.php, if your server is configured slightly different .html wont work. Plus, making your server parse html files for php slows down your server.
Originally by: Lutz Major
<html>
<body>
Players:
<?
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
?> </body> </html>
Originally by: Lutz Major
The code between <? and ?> is then "compiled" and executed on the server, if you request the file. If you call e.g. http://localhost/test.html, the result should be Players: 12345 .
Don't use <? and ?> use <?php and ?> Some servers aren't configured for short tags so its best to use long tags. So the new code would be:
<?php
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
?> </body> </html>
Quantum Industries is recruiting! |

Commander Ventura
Inter corporation logistics SwineFlu.
|
Posted - 2009.10.21 08:11:00 -
[16]
Hmm well i did it and it works now =) look
there is a 3 min cache on it http://www.uk-time.co.cc/api/test.html
|

Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2009.10.21 09:09:00 -
[17]
Originally by: Commander Ventura Hmm well i did it and it works now =) look
there is a 3 min cache on it http://www.uk-time.co.cc/api/test.html
Didn't say it wont work, said it wont work for everyone.
Quantum Industries is recruiting! |

Catari Taga
Centre Of Attention Rough Necks
|
Posted - 2009.10.21 13:08:00 -
[18]
Edited by: Catari Taga on 21/10/2009 13:09:05
Originally by: Lutz Major This IS the simpliest code snip
Originally by: Sleepkevert
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
No, that isn't the simplest yet, better to load directly into a SimpleXML object:
$xml = simplexml_load_file("http://api.eve-online.com/server/ServerStatus.xml.aspx"); print($xml->result->onlinePlayers);
PS: Apart from that all good advice by Johnathan Roark, I'd listen to him and learn doing it the right way from the start.
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.21 13:57:00 -
[19]
Edited by: Lutz Major on 21/10/2009 13:59:43
Originally by: Catari Taga ....
Of course ... how could I miss that! 
Here is what I think:
[-]>[-]< >+++++++++[<+++++++++>-]<--------. >++++++[<------>-]<-----. >++++++++[<++++++++>-]<++++. >+++[<+++>-]<++. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<---. +. >++[<++>-]<+. >+++++++++[<--------->-]<---. >++++++++[<++++++++>-]<+++. --. >++++[<++++>-]<+. >++++[<---->-]<+++. >++++++++[<-------->-]<----.
The first who can translate it, will get 1 million ISK 
|

Kravek
Lamb Federation Navy C0VEN
|
Posted - 2009.10.21 14:29:00 -
[20]
Edited by: Kravek on 21/10/2009 14:30:50 This is program written in Brain****. I`m to lazy to translate this to something readable 
It got output: "I do not care!"
|
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.21 14:41:00 -
[21]
Originally by: Kravek
This is program written in Brain****. I`m to lazy to translate this to something readable 
It got output: "I do not care!"
Congratulations, I just won one million ISK! I'll transfer the money as soon as I will log in again 
With it I meant, I do not care, whether there are three lines of code or just two :-) IMHO the mock-up by Sleepkevert was sufficient.
More of a problem will be the caching and error handling, if the api is (yet again) not available.
Regards, Lutz
|

Arous Drephius
|
Posted - 2009.10.21 15:03:00 -
[22]
Originally by: Johnathan Roark Useful tips about PHP
Listen to this.
|

Catari Taga
Centre Of Attention Rough Necks
|
Posted - 2009.10.21 17:14:00 -
[23]
Originally by: Lutz Major IMHO the mock-up by Sleepkevert was sufficient.
Haha, no doubt, I think you took me a little bit too serious there although I liked the style of your response!
|

Darriele
Minmatar Zenith Affinity
|
Posted - 2009.10.24 19:20:00 -
[24]
Edited by: Darriele on 24/10/2009 19:25:45 direct server query - offset 0x14 - 2 bytes -> online players. example(took me half an hour to realize where the hell is the number of players located ) :
<?php
$fp = fsockopen("87.237.38.200", 26000, $errno, $errstr, 30); $out= "status?"; //we just want the error and connection closed. no awesome stuff required $in=""; fwrite($fp,$out); while(!feof($fp)){ $in.=fgets($fp,128); } $lb=ord(substr($in,0x14,1)); $mb=ord(substr($in,0x15,1)); echo($mb*0x100+$lb); ?>
Edit: Anyway I rather go with the API since it gives more info.
|

Catari Taga
Centre Of Attention Rough Necks
|
Posted - 2009.10.25 02:12:00 -
[25]
Originally by: Darriele direct server query
You may want to read http://www.eveonline.com/news.asp?a=single&nid=2570&tid=1:
Originally by: CCP Please keep in mind that a request to the proxies, coming from your application, may result in the player's IP being evaluated as hostile by our load balancer. The EVE API service is the recommended and only supported public access to server status information
|

Darriele
Minmatar Zenith Affinity
|
Posted - 2009.10.25 06:34:00 -
[26]
Originally by: Catari Taga
Originally by: Darriele direct server query
You may want to read http://www.eveonline.com/news.asp?a=single&nid=2570&tid=1:
Originally by: CCP Please keep in mind that a request to the proxies, coming from your application, may result in the player's IP being evaluated as hostile by our load balancer. The EVE API service is the recommended and only supported public access to server status information
no steves!
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |