Yo API PHP Package
Requires
- php: >=5.4.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 4.1.0
- satooshi/php-coveralls: dev-master
README
#Yo (v0.2.1) This package lets u perform actions on the Yo Developers API.
It has no extra dependencies but it can play nice with other curl or http clients by creating an adapter
just implement the YoClientInterface and inject it into the Yo
class.
Documentation
We encourage you to read the documentation carefully before proceeding.
Installing via Composer (recommended)
Install composer in your project:
curl -s http://getcomposer.org/installer | php
Create a composer.json file in your project root:
{ "require": { "websoftwares/yo": "~0.2" } }
Install via composer
php composer.phar install
Usage
Basic usage of the Yo
class.
use Websoftwares\YoClient, Websoftwares\Yo; // apiKey $apiKey = 'obtain-valid-api-key-from-yo'; // Instantiate class $Yo = new Yo(new YoClient($apiKey)); // Perform method $yo->all();
all();
This will yo all your subscribers
$yo->all();
(optional) provide a link argument This will yo all your subscribers with a link
$yo->all("yo.websoftwar.es");
user();
This will yo an individual user
$yo->user("BORIS010");
(optional) provide a link argument This will yo an individual user with a link
$yo->user("BORIS010", "yo.websoftwar.es");
subscribersCount();
Returns the amount of subscribers
$yo->subscribersCount();
Testing
In the tests folder u can find several tests.
Goals
- Unit testing 100%
- PSR compliance
- Implement new methods from Yo API when they are available
License
The MIT License (MIT).