PHP code example of kbsali / gsm-api

1. Go to this page and download the library: Download kbsali/gsm-api 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/ */

    

kbsali / gsm-api example snippets




// This file is generated by Composer
p://webpull.globalsportsmedia.com', 'USERNAME', 'PASSWORD');
$client
    ->cacheOn() // for live method (like get_matches_live_updates) you might want to disable caching
    ->setCacheDir(__DIR__.'/cache') // path where xml responess will be cached
;

try {
    $seasons = $client->api('soccer')->get_seasons(['authorized' => 'yes']);
    foreach ($seasons->competition as $competition) {
        foreach ($competition->season as $season) {
            $matches = $client->api('soccer')
                ->cacheOncePerDay() // cache, but only once a day!
                ->get_matches(
                    (int) $season['season_id'],
                    'season',
                    ['detailed' => 'yes', 'start_date' => date('Y-m-d H:00:00')]
                )
            ;
            // process matches...
        }
    }
} catch(\Exception $e) {
    die($e->getMessage());
}
bash
$ php composer.phar