2017 © Pedro Peláez
 

library foursquare-api-client

PHP Foursquare Api Client built on Guzzle

image

jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  • Wednesday, February 8, 2017
  • by jcroll
  • Repository
  • 3 Watchers
  • 40 Stars
  • 73,815 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 19 Forks
  • 0 Open issues
  • 14 Versions
  • 3 % Grown

The README.md

JcrollFoursquareApiClient

Build Status Total Downloads Monthly Downloads Latest Stable Version License, (*1)

Find the Symfony Bundle for this library here., (*2)

Why?

There is no library currently built to interact with the foursquare api using the fantastic Guzzle HTTP Client library. Guzzle is awesome and supplies a lot of great things for building web service clients. Guzzle is fully unit tested which allows this library to be a light wrapper around the Guzzle core. You can read more about Guzzle here., (*3)

Installation

The JcrollFoursquareApiClient is available on Packagist (jcroll/foursquare-api-client) and as such installable via Composer., (*4)

If you do not use Composer, you can grab the code from GitHub, and use any PSR-4 compatible autoloader (e.g. the Symfony ClassLoader component) to load the library's classes., (*5)

Guzzle Versioning

This package is compatible with different versions of Guzzle (see below):, (*6)

Guzzle Version Foursquare Client Version
~3 ~1
~4, ~5 ~2
~6 ~3

Composer example

Add JcrollFoursquareApiBundle in your composer.json:, (*7)

{
    "require": {
        "jcroll/foursquare-api-client": "~3"
    }
}

Download the library:, (*8)

``` bash $ php composer.phar update jcroll/foursquare-api-client, (*9)


After installing, you need to require Composer's autoloader somewhere in your code: ```php require_once 'vendor/autoload.php';

Usage

use Jcroll\FoursquareApiClient\Client\FoursquareClient;

$client = FoursquareClient::factory([
    'client_id'     => 'your_foursquare_client_id',     // required
    'client_secret' => 'your_foursquare_client_secret', // required
    'version'       => 20140806,                        // optional
    'mode'          => 'foursquare',                    // optional (one of 'foursquare' or 'swarm')
]);

$client->setToken($oauthToken);  // optionally pass in for user specific requests

$client->setMode('swarm');       // switch from mode 'foursquare' to 'swarm'

$command = $client->getCommand('venues/search', [
    'near'  => 'Chicago, IL',
    'query' => 'sushi'
]);

$results = (array) $client->execute($command); // returns an array of results

You can find a list of the client's available commands in the bundle's client.json but basically they should be the same as the api endpoints listed in the docs., (*10)

Oauth Integration

Endpoints in the foursquare API that are user specific will require authorization with foursquare using the Oauth 2.0 protocol., (*11)

If you're using the HWIOAuthBundle with Symfony you can install the JcrollFoursquareApiBundle for automatic integration with your oauth requests., (*12)

Otherwise oauth protocol authorization is beyond the scope of this library but you can find a list of possible libraries here. After authorization you can pass the access token into the client for user specific access., (*13)

The Versions

08/02 2017

dev-master

9999999-dev https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

08/02 2017

v3.0.2

3.0.2.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

29/12 2016

v3.0.1

3.0.1.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

29/12 2016

v3.0.0

3.0.0.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

07/09 2016

v2.1.1

2.1.1.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

01/09 2016

v2.1.0

2.1.0.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare

26/08 2016

v2.0.1

2.0.1.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api client foursquare

26/08 2016

v2.0.0

2.0.0.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api client foursquare

25/08 2016

v1.1.1

1.1.1.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

api client foursquare

25/08 2016

v1.1.0

1.1.0.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

api client foursquare

09/08 2013

v1.0.3

1.0.3.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

api client foursquare

09/08 2013

v1.0.2

1.0.2.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

api client foursquare

06/08 2013

v1.0.1

1.0.1.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client built on Guzzle

  Sources   Download

MIT

The Requires

 

api client foursquare

19/07 2013

v1.0.0

1.0.0.0 https://github.com/jcroll/foursquare-api-client

PHP Foursquare Api Client

  Sources   Download

MIT

The Requires

 

api client foursquare