ben-gibson / foursquare-venue-client
A PHP client library for accessing the Foursquare userless venue endpoint.
Installs: 1 511
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ~5.6|~7.0
- beberlei/assert: ^2.6
- php-http/client-common: ^1.0
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.0
Requires (Dev)
- php-http/guzzle6-adapter: ^1.0
- php-http/mock-client: ^0.3.2
- phpunit/phpunit: ~5.0
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2024-11-10 03:05:23 UTC
README
A PHP
client library for interacting with the Foursquare
userless venue API.
HTTPlug is used to support multiple HTTP
clients including Guzzle
, Buzz
, and Curl
.
Install
Use composer to install this library and your preferred HTTP
client.
$ composer require php-http/guzzle6-adapter $ composer require ben-gibson/foursquare-venue-client
Usage
<?php require_once __DIR__.'/../vendor/autoload.php'; use Gibbo\Foursquare\Client\Client; use Gibbo\Foursquare\Client\Configuration; use Gibbo\Foursquare\Client\Entity\Coordinates; use Gibbo\Foursquare\Client\Factory\Venue\VenueFactory; use Gibbo\Foursquare\Client\Identifier; use Gibbo\Foursquare\Client\Options\Search; $client = Client::simple(new Configuration('client-id', 'client-secret'), VenueFactory::simple()); // Get by id $venue = $client->getVenue(new Identifier('430d0a00f964a5203e271fe3')); $venue->getName(); $venue->getDetails()->getRating(); // Search by coordinates $options = Search::coordinates(new Coordinates(28.538336, -81.379234)) ->limit(10) ->radius(500) ->query('Donuts'); $venues = $client->search($options); // Search by place $options = Search::place('Chicago, IL') ->limit(10) ->radius(500) ->query('Donuts'); $venues = $client->search($options);
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ben.gibson.2011@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.