2017 © Pedro Peláez
 

symfony-bundle foursquare-api-bundle

Symfony bundle for the jcroll/foursquare-api-client

image

jcroll/foursquare-api-bundle

Symfony bundle for the jcroll/foursquare-api-client

  • Thursday, September 15, 2016
  • by jcroll
  • Repository
  • 2 Watchers
  • 7 Stars
  • 16,429 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

JcrollFoursquareApiBundle

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

This bundle integrates the JcrollFoursquareApiClient into the Symfony framework., (*2)

Why?

This bundle will allow you to easily configure the JcrollFoursquareApiClient and additionally easily allow you to integrate with the HWIOAuthBundle (if you are using it) for signed requests to the foursquare api (see the JcrollFoursquareApiBundleSandbox for examples)., (*3)

Installation

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

{
    "require": {
        "jcroll/foursquare-api-bundle": "~1"
    }
}

Download bundle:, (*5)

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


Add the JcrollFoursquareApiBundle to your AppKernel.php ```php // app/AppKernel.php public function registerBundles() { $bundles = array( ... new Jcroll\FoursquareApiBundle\JcrollFoursquareApiBundle(), ... ); ... }

Basic configuration

  1. If you're not using HWIOAuthBundle add your application id and secret parameters (other parameters are optional):, (*7)

    # app/config/config.yml
    
    jcroll_foursquare_api:
        client_id:     <your_foursquare_client_id>     
        client_secret: <your_foursquare_client_secret>
        version:       20140806                        # optional
        mode:          foursquare                      # optional
    
  2. If you are using HWIOAuthBundle configure a foursquare resource owner and the client's credentials will automatically be configured (unless you wish to specify custom values for version or mode)., (*8)

    # app/config/config.yml
    
    hwi_oauth:
        resource_owners:
            any_name:
                type:          foursquare
                client_id:     <your_foursquare_client_id>     # will automatically inject in the client
                client_secret: <your_foursquare_client_secret> # will automatically inject in the client
    

Usage

$client = $this->container->get('jcroll_foursquare_client');

$client->setToken($oauthToken); // optional 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., (*9)

HWIOAuthBundle Integration

If you are using HWIOAuthBundle this bundle will automatically look for a resource_owner of type foursquare in that bundle's configuration and inject the client_id and client_secret into the jcroll_foursquare_client service (no need to configure this bundle unless you want to define custom values for version or mode)., (*10)

Additionally a listener will be configured and if the authenticated user possesses an oauth token belonging to foursquare the token will be automatically injected into the jcroll_foursquare_client service for signed requests (no need to call setToken)., (*11)

The Versions

15/09 2016

dev-master

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

Symfony bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

The Development Requires

api oauth client swarm foursquare hwioauthbundle

07/09 2016

v1.1.4

1.1.4.0 https://github.com/jcroll/foursquare-api-bundle

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

The Development Requires

api client foursquare

30/08 2016

v1.1.3

1.1.3.0 https://github.com/jcroll/foursquare-api-bundle

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

The Development Requires

api client foursquare

26/08 2016

v1.1.2

1.1.2.0 https://github.com/jcroll/foursquare-api-bundle

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

api client foursquare

26/08 2016

v1.1.1

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

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

api client foursquare

14/07 2016

v1.1.0

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

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

api client foursquare

06/08 2013

v1.0.1

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

Symfony2 bundle for the jcroll/foursquare-api-client

  Sources   Download

MIT

The Requires

 

api client foursquare

19/07 2013