Jump to content
xisto Community
Sign in to follow this  
beeseven

Google Module For Checking Aim Online Status AJAXish but not really I think

Recommended Posts

This is a module that I made for the Google personalized homepage that checks AIM online status as you type.


<?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
<script type="text/javascript">
Here's the first function
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://forums.xisto.com/no_longer_exists/;		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.
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.
</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.
</form>   </div>  ]]> </Content></Module>

You can add this to your own Google personalized homepage by clicking "Add Content," then "Add by URL," and putting http://forums.xisto.com/no_longer_exists/ in the box.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.