Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Google Module For Checking Aim Online Status, AJAXish but not really I think
beeseven
post Apr 27 2006, 10:47 PM
Post #1


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



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


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
CODE
<script type="text/javascript">
Here's the first function
CODE
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.
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.
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.
CODE
    </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://www.tjhsst.edu/~tsmilack/xml/screenname.xml in the box.
Go to the top of the page
 
+Quote Post
burhan
post Apr 14 2008, 10:22 PM
Post #2


Newbie
*

Group: Members
Posts: 8
Joined: 16-March 08
Member No.: 59,420



Thank you! but why not you use any other AIM Status Checker tool?

This post has been edited by burhan: Apr 14 2008, 10:23 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Google Pagerank In Tour Web(0)
  2. Would You Shop Using Your Cellphone(10)
  3. Checking Size Of Web Pages(18)
  4. Making A Module For Personalized Google(2)
  5. Play Mp3 Music Online(11)
  6. Wanna Learn Html From Scratch(5)
  7. My Images Wontshow Online(2)


 



- Lo-Fi Version Time is now: 6th October 2008 - 06:55 PM