phpDocumentor ApiUptimeRobot
[ class tree: ApiUptimeRobot ] [ index: ApiUptimeRobot ] [ all elements ]

Source for file testeApiUptimeRobot.php

Documentation is available at testeApiUptimeRobot.php

  1. <?php
  2.  
  3. /**
  4.  * Arquivo de teste para utilização da API do Uptime Robot
  5.  *
  6.  * @package ApiUptimeRobot
  7.  * @version 0.1
  8.  * @author Marcelo Bom Jardim Villasanin <marcelo@onzehost.com.br>
  9.  * @copyright Copyright (c) 2011, Marcelo Bom Jardim Villasanin
  10.  * @link http://www.onzehost.com.br
  11.  */
  12.  
  13. /**
  14.  * Api do Uptime Robot
  15.  */
  16. require 'ApiUptimeRobot.php';
  17.  
  18. $uptimeRobot new ApiUptimeRobot();
  19. $uptimeRobot->setApiKey('')//Coloque aqui a sua KEY
  20.  
  21. $monitores $uptimeRobot->getMonitors();
  22. $xml simplexml_load_string($monitores);
  23.  
  24.  
  25. ?>
  26.  
  27. <table border="1">
  28.   <tr>
  29.     <td>Servidor</td>
  30.     <td>Status</td>
  31.     <td>Uptime</td>
  32.   </tr>
  33.  
  34.  
  35. <?php
  36.  
  37. foreach($xml->monitor as $monitor{
  38.  
  39.   $cStatus ApiUptimeRobot::getStatus($monitor['status']);
  40.  
  41.   echo "<tr>";
  42.   echo "<td>".$monitor['friendlyname']."</td>";
  43.   echo "<td>".$cStatus."</td>";
  44.   echo "<td>".number_format((double)$monitor['alltimeuptimeratio'],2,',','.')."%</td>";
  45.   echo "</tr>";
  46. }
  47.  
  48. ?>
  49.  
  50. </table>

Documentation generated on Sat, 15 Oct 2011 12:48:49 -0300 by phpDocumentor 1.4.3