Aller à la page... |
BETA Widget PHP - Server Status
Suivre Répondre |
|
Partager | Rechercher |
Prophète
|
Un peu d'eau à coulé sous les ponts depuis.
On sait maintenant que SOE met à dispo une API. A l'heure actuelle cette API est en test chez Planetside Universe. D'ici que l'API soit accessible à tous je vous propose un script PHP qui scrap la page de Planetside Universe pour récupérer l'état du serveur qui nous intéresse. Requiert PHP + CURL Code HTML:
<?php
function extraction($string, $start, $end)
{
$pos = stripos($string, $start);
$str = substr($string, $pos);
$str_two = substr($str, strlen($start));
$second_pos = stripos($str_two, $end);
$str_three = substr($str_two, 0, $second_pos);
$unit = trim($str_three);
return $unit;
}
$url = "http://www.planetside-universe.com/server_status.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT,'Googlebot/2.1 (+http://www.google.com/bot.html)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scrap_psu = curl_exec($ch);
curl_close($ch);
$text = $curl_scrap_psu;
// changer ici le nom de son serveur comme écrit sur http://www.planetside-universe.com/server_status.php
$start = 'Server:Miller">Miller</a></td>';
$end = '</tr><tr>';
$unit = extraction($text, $start, $end);
echo "<table><td>Miller</td>$unit</tr></table>";
?>
zyzko @ FRC |
10/12/2012, 21h51 |
|
|
|
12/12/2012, 16h19 |
|
|
Citation :
|
12/12/2012, 17h44 |
|
|
|
12/12/2012, 18h35 |
|
|
par ailleurs un moyen d'avoir le ping ig ? ou alors si on arrive a avoir l'ip des serveurs.. ?
|
12/12/2012, 19h59 |
|
Prophète
|
Pour ceux que ça intéresse le flux du statut de serveurs est dispo sur:
http://data.soe.com/status/ps2 Le reste des infos ne semble pas encore accessible: http://data.soe.com/xml/get/ps2/ http://data.soe.com/xml/get/ps2/character/ etc. à suivre. |
15/02/2013, 15h47 |
|
Prophète
|
|
13/03/2013, 18h43 |
|
Suivre Répondre |
Fil d'ariane
Connectés sur ce fil1 connecté (0 membre et 1 invité)
Afficher la liste détaillée des connectés
|