This is not too hard to do. The hard part is just holding a conversation with the AIM servers. Once you do that, you just send "toc_get_info [user name]" if I remember correctly.
You then listen for the response. If the response doesn't have "GOTO_URL" in it, then the user is not online and you can't get the profile. If the user is online, it will have a "GOTO_URL" in the response. You then have to build the link which looks something like:
[url]http://[/url][TOC HOST (IP)]:[TOC PORT]/[GOTO_URL data]
Building this URL took a little work to figure out. Its important that you use exactly same AIM server IP you used to issue the query, otherwise this won't work.
Look for "
function sserver_getuserinfo" in my "aimfunctions.php" file. I've built a socket server to TOC gateway here: http://www.rsbauer.com/webdev.php (scroll to the bottom).