contactmyreps / sunlight-php
A PHP wrapper for Sunlight Foundation's API
v1.0
2016-03-03 00:14 UTC
Requires
- php: ~5.5|~7.0
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- fzaninotto/faker: ^1.5
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2024-11-09 19:45:43 UTC
README
A limited PHP wrapper for the Sunlight Foundation APIs designed for use on contactmyreps.org
Install
Via Composer
$ composer require contactmyreps/sunlight-php
Usage
$sunlight = new Sunlight($apikey); $openStates = $sunlight->openStates(); $congress = $sunlight->congress(); //get all Alabama's state legislators $states->legislators( [ 'state' => 'AL' ], ); //get all State reps serving a gps coordinate $states->geoLookup($lat, $lng); //get all Congressional representatives serving an area $congress->locateByZip(11111); $congress->locateByGeo($lat, $lng); $request methods can be passed an optional extra array argument of display fields to return (last_name, first_name, etc.)
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email edfialk@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.