<?php
$d = new Dbus;
$n = $d->createProxy(
"im.pidgin.purple.PurpleService",
"/im/pidgin/purple/PurpleObject",
"im.pidgin.purple.PurpleInterface"
);
$data = $n->PurpleAccountsGetAllActive();
foreach( $data->getData() as $account )
{
$buddies = $n->PurpleFindBuddies( $account, '' );
$protocol = $n->PurpleAccountGetProtocolName( $account );
echo $protocol, "\n";
foreach ( $buddies->getData() as $buddyId )
{
$online = $n->PurpleBuddyIsOnline( $buddyId );
$alias = $n->PurpleBuddyGetAlias( $buddyId );
if ( $online )
{
printf( "- %s\n", $alias );
}
}
}
?>