Download the PHP package gilberg-vrn/php-foursquare without Composer
On this page you can find all versions of the php package gilberg-vrn/php-foursquare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gilberg-vrn/php-foursquare
More information about gilberg-vrn/php-foursquare
Files in gilberg-vrn/php-foursquare
Package php-foursquare
Short Description A simple PHP library for accessing the foursquare API (see: https://developer.foursquare.com)
License
Informations about the package php-foursquare
Why another Foursquare library?
I couldn't find a php library for the Foursquare API that encapsulated all the functionality of the API while still remaining easy to plug in to an application quickly. This library seeks to fill that need.
Installation
The best way to install Foursquare library is to use Composer:
If you are not using an autoloader, you need to require_once the autoload file:
Another way to install is to download the latest version directly from this repository.
Usage
This library wrappers for php applications to make requests to both public and authenticated-only resources on Foursquare. As well it provides functions that encapsulate the main methods needed to retrieve an auth_token for a user from Foursquare. Instead of having explicit functions for calling API endpoints, you can call individual endpoints directly by their path (eg. venues/40a55d80f964a52020f31ee3/tips)
Querying the API
Authenticating the user (see examples/tokenrequest.php)
Adding features & testing
If you want to commit features, please also update the tests/FoursquareApiTest.php file with a proper unit test - this will ensure changes can be accepted more quickly.
Running tests requires phpunit, and can be run as the following:
PROTIP: The easiest way to get an access token to test with is to look yourself up in the api explorer and pull it directly from the grayed-out url information (OAuth token automatically added. https://api.foursquare.com/v2/users/self?oauth_token=...) underneath the input box.
What else do I need?
This library does not deal with the management of your tokens - only the interaction between your code and the Foursquare API. If you are using it in an application that needs to use user data via an auth_token, you will need to store the token across sessions separately from the library.