Google Civic API Client
This is a minimalistic API client for Google Civic API, (*1)
Installation
Installation is conveniently provided via Composer., (*2)
To get started, install composer in your project:, (*3)
$ curl -s https://getcomposer.org/installer | php
Next, add a composer.json file containing the following:, (*4)
}
"require": {
"google/civic-client": "dev-master"
}
}
Finally, install!, (*5)
$ php composer.phar install
Usage
Using the Google Civic client is easy:, (*6)
``` php, (*7)
<?php, (*8)
require_once '../src/Client.php';, (*9)
try {
$client = new GoolgeCivic('YOUR API KEY');
$result = $client->getElections();
} catch (Exception $e) {
echo $e->getMessage();
}
print_r($result);, (*10)
```, (*11)