PHP client for Skype Web API
PHP client for Skype Web API, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ php composer.phar require djiele/skype-web-php "dev-master"
or add, (*4)
"djiele/skype-web-php": "dev-master"
to the require
section of your composer.json
file., (*5)
use skype_web_php\Skype; $appDataPath = getcwd().DIRECTORY_SEPARATOR.'app-data'.DIRECTORY_SEPARATOR; $skype = new Skype($username, $passwd, $appDataPath);
where $username is your skype login (no phone number support yet),, (*6)
$password is self explanatory, (*7)
$appDataPath is the path to the app-data folder where are cached skype current connection (one day expiry), (*8)
use cached connection if not expired or do the full login process, (*9)
$skype->login() or die('Login failed'); echo 'Connected as ', $skype->getMyDisplayname(), PHP_EOL;
if($skype->updateProfile(["richmood" => "i am very happy <ss type=\"laugh\">:D</ss>", "mood" => " i am very happy" , "firstName" => "John", "lastName" => "Doe"])) {` echo 'profile updated', PHP_EOL; } if($skype->updateAvatar("/path/to/image")) {` echo 'avatar updated', PHP_EOL;` $skype->downloadAvatar(/path/to/folder/);` }
$skype->enableMessaging(Skype::STATUS_HIDDEN);
$contact_id = '8:live:username'; $message_id = $skype->sendMessage("Hello: ".date('Y-m-d H:i:s'), $contact_id); $skype->editMessage("Hello: ".date('Y-m-d H:i:s'), $contact_id, $message_id); $skype->deleteMessage($contact_id', $message_id);
$fileInfos = $skype->sendFile([$contact_id=>['read', 'write']], /path/to/file); $imgInfos=$skype->sendImage([$contact_id=>['read', 'write']], /path/to/image)) $message_id = $skype->sendContact($contact_id, $contact_id_to_be_sent);
$messages = $skype->getNewMessages();
$skype->disableMessaging(); $skype->logout();
skype-web can also, (*10)