Display AIM status
By: Daniel
Have you ever wanted to show the status of AIM on your website. The following code will display weather or not your screen name or any other specified screename is onlne or offline.
This code cannot display if they are away or idle or what their away message is, but in general if they are online or not.
$screenName = "YOUR SN HERE"; // Add your screename to the $screenName variable // Connect to AOL server $url = @fsockopen("big.oscar.aol.com", 80, &$errno, &$errstr, 3); // Query the Server fputs($url, "GET /".$screenName."?on_url=online&off_url=offline HTTP/1.0\n\n"); // See resultant page while(!feof($url)){ $feofi++; $page .= fread($url,256); if($feofi > 10){ $page = "offline"; break; } } fclose($url); // Close the connection to big.oscar.aol.com // determine online status if(strstr($page, "online")){ echo '<img src="http://www.aol.com/aim/gr/online.gif" /> '.$screenName.' is online'; }else{ echo '<img src="http://www.aol.com/aim/gr/offline.gif" /> '.$screenName.' is offline'; }
The last part of this code does the status checking and shows an icon with the status. You may wish to consider copying the online.gif and offline.gif code to your server.
Enjoy!





May 10th, 2008 at 6:39 am
Thanks for the script.
P.S. In the second sentence on top of your post: “weather” is a meteorological condition. “Whether” is a conjunction that expresses doubt or choice.