With Yahoo, Gmail and then MSN all dealt with my attention has turned to AIM. I hadn't been able to find a class specifically designed to grab a contact list from an AIM account but I could find
this class which can interact with the AIM network. Using it to grab a list of contacts is actually quite easy.
This entry is one of a series looking at fetching contacts. For a summary of all the important facts, sample code and the download link please view the AIM contact grab page in the scripts section.
The code is as follows.
<?phpinclude("aimclassw.php");
include("dconnection.php");
$screenName=
"screen_name";
//Your bots screen name$password=
"password";
//Your bots password$b=
new Aim;
$b->
connect($screenName,
$password);
$b->
myServer=
"toc-m08.blue.aol.com";
$b->
myServer=
"aimexpress.oscar.aol.com";
$b->
signon();
$x=
0;
while($x <
5){ $b->
receive();
$b->
myLastReceived=
"";
$x++;
}//Get the contact list in an array$contacts =
$b->
getBuddies();
//Display the arrayvar_dump($contacts);
?>
Although this will grab a contact list the class also prints out a lot of info which isn't needed so I'll need to re-write parts of it before it is ready for use in this context.
Another issue is what to do with the contact list once it has been downloaded. Unlike MSN and Gmail the screen names are not as directly associated with an email address. It has been a while since I last used AIM but when I did I never checked the email address attached to it. It may be best to send an instant message to the contacts but is this possible for offline contacts? I don't know but I intend to find out.