IRLP Status Script (IFRAME)

In the past I had a made a PHP Script that could be used to show the status of an IRLP Node on one's website. In early November I noticed that the file I was getting my data from was changed as to how it was served up. I had two choices on how I could fix the script. Choice one was to alter the script to unzip the text file and choice two was to completely rewrite the script to parse an HTML page the served live data. If you remember back to the old script, there was a two minute lag between updates. Now it is instantaneous.
The way you implement the script into your page is also a little bit different. You will need to use an "IFRAME" where you want the status to show up on your page. Doing this allows for two things. One is the ability to have the status script refresh while the page it is on does not refresh. The second, is the ability to have more than one node status displayed on a page in an easy, user customizable way.
There are some new features also. The first is the ability to change the background color and the text color by declaring what you want in the query of the URL called in the IFRAME. The second feature is the time values. The script will only show to measurements of time when it shows how long the node has been in the STATE is in. For example, if node 1000 has been IDLE for 0 Days, 5 Hours, 29 Minutes, 48 Seconds Then the status will read like this:
Node 1000 is IDLE for 5 Hours, 29 Minutes.
The script will only show the two larges time values that have any data in them.
There is one last feature and it has to do with the refresh rate of the script. By default, the ability to refresh the script is on and if the status is showing the seconds value then the script will automatically refresh every 5 seconds. If the status is not showing the seconds value, then the status is refreshed every minute. You also have the ability to turn off the refresh so that it will not refresh, thus saving a few KB of bandwidth.
Here is an example code of what you would put in your HTML page where you want the script to show up:
<iframe src="http://www.towerboy.com/irlp/script.php?node=1000" width="100%" height="20" frameborder="0">If you can see this, your browser doesn't understand IFRAME.</iframe>
That code will display the following:
Notice that there is no color formatting. If you want your background to be black and your text to be turquoise, then you would add "&bgcolor=000000&textcolor=00CCFF" to the end of the URL in the IFRAME like the following example:
<iframe src="http://www.towerboy.com/irlp/script.php?node=1000&bgcolor=000000&textcolor=00CCFF" width="100%" height="20" frameborder="0">If you can see this, your browser doesn't understand IFRAME.</iframe>
This will display the following:
If you want to disable the auto refresh, then you need to add "&refresh=off" to the URL also:
<iframe src="http://www.towerboy.com/irlp/script.php?node=1000&bgcolor=000000&textcolor=00CCFF&refresh=off" width="100%" height="20" frameborder="0">If you can see this, your browser doesn't understand IFRAME.</iframe>That code will not refresh like the following example:
If you have any questions or have an idea on how to improve the script, email me here: ns7r at towerboy dot com




