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