###A PHP client for Yahoo! Messenger API
- login
- logout
- avatar retrieval
- groups with contacts list retrieval
- notifications retrieval (messages, buddy requests...)
- messages sending
- authorizing buddies
- checking yahoo session & keeping it alive
- Using Composer
Add the following to your composer.json
file located in the root directory of your project.
{
"require": {
"bogcon/yahoo-messenger-api": "dev-master"
}
}
Then you can run the Composer install/update command from the directory containing the composer.json
file
# download composer (skip the next command if you already have composer)
$ curl -sS https://getcomposer.org/installer | php
# install dependencies
$ php composer.phar install
$ php composer.phar update
- Using GIT
git clone https://github.com/bogcon/yahoo-messenger-api.git
- Download the ZIP archive from here
try {
// initialize client
$objYmClient = new \BogCon\YahooMessengerApi\Client('myYahooUsername', 'myYahooPass', 'app_key', 'app_secret');
// send a message to a friend
$objYmClient->logIn(\BogCon\YahooMessengerApi\Client::USER_IS_OFFLINE) // login as Invisible
->sendMessage('Hello...Just entered to remind you about our meeting from tomorrow. Bye, see ya.', 'myBuddyId')
->logOut();
echo 'Successfully transmitted message to my friend.';
} catch (\BogCon\YahooMessengerApi\Exception $objEx) {
echo 'Something went bad: ' . $objEx->getMessage();
}
A simplistic browser based Yahoo Messenger chat that uses this library can be found here.
http://developer.yahoo.com/messenger/guide/ch02.html
yahoo-messenger-api
is released under the New BSD License
which is the 3-clause BSD license.
You can find a copy of this license in LICENSE.txt.