Click here to Skip to main content
15,886,069 members
Articles / Desktop Programming / Windows Forms

AIM Session Tracker Utility

Rate me:
Please Sign up or sign in to vote.
4.60/5 (5 votes)
2 Mar 2009CPOL1 min read 51K   296   7   1
Tracks the status of an AIM user (online, away, offline).

AIMTracker

ss_program.jpg

Introduction

This is my first CodeProject article. I've made a small AIM instant messenger session tracker utility. I took the image from here. If this is a copyright violation, please let me know.

This program polls the status of any AIM user by visiting a special link.

The Code

The essence of the program is only one line:

http://api.oscar.aol.com/presence/get?k=DEVELOPERKEY&f=xml&t=SCREENNAME1&t=SCREENNAME2...

This allows you to get the state of the AIM user - online, away, offline. Note that it is not possible to check if a user is invisible or not using this URL (although there is a way to check if a user was invisible or not after they come back online). Also, you need a developer key to use this service (you can get one here).

Since this URL returns an XML document, I processed it with XML tools from the C# library. Here's the general method I used to get each individual element; you can't copy and paste it into Visual Studio, but it should give you a general direction:

C#
XmlDocument xDoc = new XmlDocument();
xDoc.Load("http://api.oscar.aol.com/presence/get?k=DEVELOPERKEY&f=xml&t=SCREENNAME");
XmlNodeList Users = xDoc.GetElementsByTagName("user");  
foreach (XmlNode User in Users)
{
       string Screenname = User["displayId"].InnerText;
}

Points of Interest

I've always noticed .NET programs take up a fair chunk of memory, so I Googled 30 minutes about how to reduce .NET program memory sizes. And, I found a useful link: http://bytes.com/groups/net-c/302104-forcefully-releasing-memory.

This is how to reduce program memory size:

C#
public static void ReduceMemoryUsage()
{
    try
    {
        Process CurrentProcess = Process.GetCurrentProcess();
        CurrentProcess.MaxWorkingSet = CurrentProcess.MinWorkingSet;
    }
    catch { }
}

Conclusion

There's not much to the code. Download and use the program as it is. The developer key in the download above is my developer key, so I would appreciate it if each of you could get your own developer key.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalplm Pin
pedoz10-Nov-09 12:16
pedoz10-Nov-09 12:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.