Code: Select all
<iframe src="http://www.nfoservers.com/query/stat.pl?id=bf3sea01" width=400 height=600 frameborder=0></iframe>
You can also customize the output to match your site, because every part of the page the script generates can be controlled by a stylesheet. The default stylesheet is here -- you can right-click and select "Save As" to save it to your hard drive. After editing it, upload the file to your webspace. You can specify the customized stylesheet when you call our script by using the "style" parameter. For instance, if I were to create my own stylesheet named "white.css" and upload it to my webspace, I could use this in my webpage instead of what was given above:
Code: Select all
<iframe src="http://www.nfoservers.com/query/stat.pl?style=http://mysubdomain.nuclearfallout.net/white.css&id=chernobyl" width=400 height=600 frameborder=0></iframe>
You can even get rid of everything but a couple of lines if you want, to fit just the essentials in a small spot on your site. For example, this, which uses my minimal.css stylesheet.
Advanced users may prefer to retrieve the status information via a script and embed it directly into their page, instead of bothering with frames. For example, this short Perl script would do that:
Code: Select all
#!/usr/bin/perl
use LWP::Simple;
print qq|
Content-type: text/html
<html>
<head>
<title>Example script with server status inclusion</title>
</head>
<body>
This is Chernobyl's server status:<p />
|;
getprint "http://www.nfoservers.com/".
"query/stat.pl?style=http://www.nfoservers.com".
"/query/white.css&id=chernobyl&no-body=1";
print "<p /><i>Copyright (c) 2003 Nuclearfallout Enterprises, Inc.</i>";
You'll note that in the code fragment we used another parameter -- "no-body". A "1" for that parameter indicates to our query script that no <body> tag should be included in the page output, and it is needed because placing two body tags in one document can be unnecessary and problematic.
A PHP version of that script would look like this:
Code: Select all
<html>
<head>
<title>Example script with server status inclusion</title>
</head>
<body>
This is Chernobyl's server status:<p />
<?php
echo(implode("", file("http://www.nfoservers.com/".
"query/stat.pl?style=http://www.nfoservers.com".
"/query/white&id=chernobyl&no-body=1")));
?>
<p /><i>Copyright (c) 2003 Nuclearfallout Enterprises, Inc.</i>
</html>