PHP code example of toin0u / yo

1. Go to this page and download the library: Download toin0u/yo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

toin0u / yo example snippets




vory\HttpAdapter\CurlHttpAdapter;
use Yo\Yo;

$yo = new Yo(new CurlHttpAdapter, 'you_api_token');

// ...

// ...

$yo->user('foobar'); // Yo FOOBAR
$yo->user('foobar', new \Yo\Bag\Link('http://sbin.dk/')); // Yo FOOBAR with a link
$yo->user('foobar', new \Yo\Bag\Location(55.699953, 12.552736)); // Yo FOOBAR with a location

// ...

$yo->all(); // Yo your subscribers
$yo->all(new \Yo\Bag\Link('http://sbin.dk/')); // Yo your subscribers with a link

// ...

$yo->create('barbaz', 'newpassword');

// ...

$yo->exists('foobar'); // checks if FOOBAR exsists or not.

// ...

echo $yo->total(); // get total number of subscribers