Today's downtime gave me a chance to pick up some variables that I had missed before. This is the code for the file network_status.php (for the online/PHP version of the app). I have made changes to the gadget version as well, but until I can figure out how to display the resulting page in a format that is actually viewable, I'm gonna hold onto that. Hopefully by the end of the week I will have a working gadget.
Code:
<html>
<header><title>EQ2 Network Status</title>
<style type="text/css">
body {
background-color: #FFFFFF;
color: #000000;
font-family:Arial, Helvetica, sans-serif;
font-size: 10pt;
}
h1 {
font-size: 140%;
}
</style>
</header>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr><td><h1>EQ2 Network Status</h1></td></tr>
<tr><td>
<?php
$get_server = "eq2players.station.sony.com";
$get_page = "/en/network_status.vm";
$get_file = fsockopen($get_server, 80, $errno, $errstr, 12);
fputs($get_file, "GET ".$get_page." HTTP/1.0\r\n");
fputs($get_file, "Host: ".$get_server."\r\n");
fputs($get_file, "Referer: http://".$get_server."\r\n");
fputs($get_file, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n\r\n");
//$get_file = fopen("http://".$get_server.$get_page, "r");
while(!feof($get_file)) {
$get_data .= fread($get_file, 4096);
}
$result_parse1 = explode("<!-- NEW STATUS TOOL -->",$get_data);
$result_parse2 = explode("</td>",$result_parse1[1]);
$dirty_content1 = $result_parse2[0];
$dirty_content2 = str_replace("<span class=\"NewsSelectionHeaders\"><strong> </strong> - </span><br>","",$dirty_content1);
$dirty_content3 = str_replace("<span class=\"server_status_locked\">","<img src=\"images\locked.gif\"> ",$dirty_content2);
$dirty_content4 = str_replace("<span class=\"serverunavailable\">","<img src=\"images\locked.gif\"> ",$dirty_content3);
$dirty_content5 = str_replace("<span class=\"serverup\">","<img src=\"images\up.gif\"> ",$dirty_content4);
$dirty_content6 = str_replace("<span class=\"serverdown\">","<img src=\"images\down.gif\"> ",$dirty_content5);
$dirty_content6b = str_replace("<span class=\"server_status_down\">","<img src=\"images\down.gif\"> ",$dirty_content6);
$dirty_content7 = str_replace("(is locked)","",$dirty_content6b);
$dirty_content7b = str_replace("<span class=\"server_status_partial\">All servers are up except for</span>","",$dirty_content7);
$dirty_content8 = str_replace("<span class=\"server_status_all_up\">All Servers Are Up</span><br>","<img src=\"images\up.gif\"> Guk<br><img src=\"images\up.gif\"> The Bazaar<br><img src=\"images\up.gif\"> Lucan DLere<br><img src=\"images\up.gif\"> Butcherblock<br><img src=\"images\up.gif\"> Nektulos<br><img src=\"images\up.gif\"> Kithicor<br><img src=\"images\up.gif\"> Unrest<br><img src=\"images\up.gif\"> Crushbone<br><img src=\"images\up.gif\"> Blackburrow<br><img src=\"images\up.gif\"> Najena<br><img src=\"images\up.gif\"> Everfrost<br><img src=\"images\up.gif\"> Befallen<br><img src=\"images\up.gif\"> Permafrost<br><img src=\"images\up.gif\"> Mistmoore<br><img src=\"images\up.gif\"> Oasis<br><img src=\"images\up.gif\"> Venekor PVP<br><img src=\"images\up.gif\"> Antonia Bayle<br><img src=\"images\up.gif\"> Nagafen PVP<br><img src=\"images\up.gif\"> Vox PVP<br>",$dirty_content7b);
$clean_content = str_replace("</div>","",$dirty_content8);
print $clean_content;
?>
</td></tr>
</table>
</body>
</html>