CODE
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="AIM Online Status Checker" height="50" />
<Content type="html">
<![CDATA[
This is all the basic stuff you need to have it be XML<Module>
<ModulePrefs title="AIM Online Status Checker" height="50" />
<Content type="html">
<![CDATA[
CODE
<script type="text/javascript">
Here's the first functionCODE
function check()
{
var sn = document.getElementById("sn").value;
if(sn == null || sn == '')
{
document.getElementById("online").style["display"] = "none";
document.getElementById("offline").style["display"] = "none";
return;
}
sn = escape(sn.toLowerCase());
var str = "http://www.tjhsst.edu/~tsmilack/xml/ajax/sn.php?sn="+sn;
var page = _IG_FetchContent(str, function(s) { update(s); });
}
This gets the String sn from the input box with id "sn." If it's blank, it hides the things that say online and offline. Finally it uses the method _IG_FetchContent to get the status from a page I wrote that connects to the AIM server. You can find out how to do that on Google. It then calls the function update using the text from the php file.{
var sn = document.getElementById("sn").value;
if(sn == null || sn == '')
{
document.getElementById("online").style["display"] = "none";
document.getElementById("offline").style["display"] = "none";
return;
}
sn = escape(sn.toLowerCase());
var str = "http://www.tjhsst.edu/~tsmilack/xml/ajax/sn.php?sn="+sn;
var page = _IG_FetchContent(str, function(s) { update(s); });
}
CODE
function update(response)
{
if(response == "online")
{
document.getElementById("online").style["display"] = "inline";
document.getElementById("offline").style["display"] = "none";
}
else
{
document.getElementById("offline").style["display"] = "inline";
document.getElementById("online").style["display"] = "none";
}
}
Since the php file online outputs "online" or "offline," it checks which it says and hides the appropriate span, revealing the other.{
if(response == "online")
{
document.getElementById("online").style["display"] = "inline";
document.getElementById("offline").style["display"] = "none";
}
else
{
document.getElementById("offline").style["display"] = "inline";
document.getElementById("online").style["display"] = "none";
}
}
CODE
</script>
<div id="thethethe" style="font-family: Arial, Sans-Serif; font-size: 10pt;">
<form action="">
<input type="text" id="sn" size="20" maxlength="16" onkeyup="check()" /> is
<span id="online" style="font-weight: bold; color: #00FF00; display: none;">online</span>
<span id="offline" style="font-weight: bold; color: #FF0000; display: none;">offline</span><br />
<input type="button" value="Re-check" onclick="check()" />
This is the form and the two spans which say either online or offline. If you'll notice the part in the input box that says "onkeyup," that's what makes it do it as you type. If you hit Re-check, it will check if the person is online again.<div id="thethethe" style="font-family: Arial, Sans-Serif; font-size: 10pt;">
<form action="">
<input type="text" id="sn" size="20" maxlength="16" onkeyup="check()" /> is
<span id="online" style="font-weight: bold; color: #00FF00; display: none;">online</span>
<span id="offline" style="font-weight: bold; color: #FF0000; display: none;">offline</span><br />
<input type="button" value="Re-check" onclick="check()" />
CODE
</form>
</div>
]]>
</Content>
</Module>
</div>
]]>
</Content>
</Module>
You can add this to your own Google personalized homepage by clicking "Add Content," then "Add by URL," and putting http://www.tjhsst.edu/~tsmilack/xml/screenname.xml in the box.

