2017 © Pedro Peláez
 

library skype-web-php

PHP client for Skype Web API

image

djiele/skype-web-php

PHP client for Skype Web API

  • Sunday, July 22, 2018
  • by djiele
  • Repository
  • 0 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

skype-web-php

PHP client for Skype Web API, (*1)

Installation

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)

Usage

get Skype object

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)

Do the connection process

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;

Update profile

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/);`
}

Messaging

$skype->enableMessaging(Skype::STATUS_HIDDEN);
Send / edit / delete a text message
$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);
Send file, image or skype contact
$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);
Retrieve new messages
$messages = $skype->getNewMessages();

Free resources, close the connection

$skype->disableMessaging();
$skype->logout();

Others

skype-web can also, (*10)

  • send, accept or decline invitations
  • manage groupchat
  • search for contact

The Versions

22/07 2018

dev-master

9999999-dev

PHP client for Skype Web API

  Sources   Download

MIT

The Requires

  • php >=5.4.0