PHP Classes
elePHPant
Icontem

Groupon API Client: Get deal information from Groupon using its API

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (27)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2012-02-12 (3 years ago) RSS 2.0 feedNot enough user ratingsTotal: 348 All time: 6,409 This week: 1,174Up
Version License PHP version Categories  
groupon 2BSD License5.3PHP 5, E-Commerce, Web services
Description Author  

This package can get deal information from Groupon using its API.

It can send HTTP requests to Groupon Web services API Web server to perform several operations on Groupon deals.

Currently it can retrieve the lists of divisions, deals and individual deal details.

Innovation Award  
PHP Programming Innovation award nominee
February 2012
Number 6


Prize: One book of choice by Packt
Groupon is one of the most popular group discount coupon buying sites.

This class provides a pure PHP client to call Groupon Web services API to obtain information about available Groupon deals.

Manuel Lemos
Picture of Fernando André
Name: Fernando André <contact>
Classes: 3 packages by
Country: Portugal Portugal
Age: 32
All time rank: 129916 in Portugal Portugal
Week rank: 1465 Down20 in Portugal Portugal Down
Innovation award
Innovation award
Nominee: 1x

Details provided by the author  
Groupon Api client in PHP 5.3

You can copy directly from the:
src/php/ 
directory to your use case path be it in Zend Framework or other development
environment.


This code uses the namespace prefix:
Netcrash

A how to use example can be seen in the:
src/php/Netcrash/Groupon/example
directory, and can be run by using:
php exampleusage_output.txt

You will require groupon API key for online testing.
And using it like:
$api = new \Netcrash\Groupon\apiClient();
$api->setToken("API_KEY");

And can use the GCurl "Driver" or develop your own
this can be found in the directory
src/php/Netcrash/Groupon/ApiQuery/Driver/

Setting a driver can be done by using:
// this
$api->setDriver(new \Netcrash\Groupon\ApiQuery\Driver\GTest()); // for testing
// or this
$api->setDriver(new \Netcrash\Groupon\ApiQuery\Driver\GCurl()); // for online api

You can list divisions by using:
$api->getDivisions();

List deals by using:
$api->getDeals();

View a Deal Detail:
$Deal = $api->getDealById("GROUPON_DEAL_ID");

DataObjects are used to represent the results you can find these in:
src/php/Netcrash/Groupon/DataObject/
Deal has a more detailed class DealOptions because it has many properties for other return
values like price, array are returned.

Examples of return data in the json format were kept in (and other details used for testing and development):
src/php/Netcrash/Groupon/example/jsonexamples/


  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file LICENSE.txt Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagephp (1 directory)

  Files folder image Files  /  src  /  php  
File Role Description
Files folder imageNetcrash (1 directory)

  Files folder image Files  /  src  /  php  /  Netcrash  
File Role Description
Files folder imageGroupon (1 file, 3 directories)

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  
File Role Description
Files folder imageApiQuery (3 files, 1 directory)
Files folder imageDataObject (5 files)
Files folder imageexample (3 files, 1 directory)
  Plain text file apiClient.php Class Class source

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  /  ApiQuery  
File Role Description
Files folder imageDriver (3 files)
  Plain text file Deals.php Class Class source
  Plain text file Divisions.php Class Class source
  Plain text file GQuery.php Class Class source

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  /  ApiQuery  /  Driver  
File Role Description
  Plain text file GCurl.php Class Class source
  Plain text file GDriver.php Class Class source
  Plain text file GTest.php Class Class source

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  /  DataObject  
File Role Description
  Plain text file Basic.php Class Class source
  Plain text file Deal.php Class Class source
  Plain text file DealOption.php Class Class source
  Plain text file Division.php Class Class source
  Plain text file WebClient.php Class Class source

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  /  example  
File Role Description
Files folder imagejsonexamples (10 files)
  Accessible without login Plain text file exampleusage.php Example Example script
  Accessible without login Plain text file exampleusage_output.txt Output Sample output
  Accessible without login Plain text file __autoload.php Example Example script

  Files folder image Files  /  src  /  php  /  Netcrash  /  Groupon  /  example  /  jsonexamples  
File Role Description
  Accessible without login Plain text file BasicPropInDeals.txt Data Auxiliary data
  Accessible without login Plain text file Deal1.json Data Auxiliary data
  Accessible without login Plain text file DealGen.json Data Auxiliary data
  Accessible without login Plain text file DealOptions.txt Doc. Documentation
  Accessible without login Plain text file deals.json Data Auxiliary data
  Accessible without login Plain text file Deal_Options.json Data Auxiliary data
  Accessible without login Plain text file divisions.json Data Auxiliary data
  Accessible without login Plain text file example-gg-original-slanket.json Data Auxiliary data
  Accessible without login Plain text file sedDivision.sh Data Auxiliary data
  Accessible without login Plain text file tDivision.json Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%Total:348All time:6,409
 This week:0This week:1,174Up