Class Api140Proof

Description

140Proof API PHP Binding

Simple wrapper for 140Proof's REST API

Located in /Api140Proof.php (line 11)


	
			
Class Constant Summary
 ADS_USER = "/ads/user"
 API_BASE = "http://api.140proof.com"
 DEFAULT_LANG = "en"
 DELETE = "DELETE"
 EXTRA_LARGE = "960"
 GET = "GET"
 HTML = "html"
 HTML_TYPE = 'text/html'
 JS = "js"
 JSON = "json"
 JSON_TYPE = 'application/json'
 JS_TYPE = 'application/javascript'
 LARGE = "640"
 MEDIUM = "480"
 POST = "POST"
 PUT = "PUT"
 SMALL = "320"
 TINY = "240"
 XML = "xml"
 XML_TYPE = 'text/xml'
Variable Summary
mixed $return_url
Method Summary
static void getStatusCodeMessage ( $status)
void getAd (string $user_id, string $format, [integer $width = null], [float $lat = null], [float $long = null], [string $lang = null], [string $jsonp = null])
Api140Proof __construct ( $app_id, [string $api_base = self::API_BASE], string $api_id)
Variables
mixed $return_url = false (line 43)

Indicates whether API methods should return the REST URL or full response

  • access: public
Methods
static method getStatusCodeMessage (line 215)
  • access: public
static void getStatusCodeMessage ( $status)
  • $status
getAd (line 84)

Wrapper for 140Proof's /ads/user

Returns an ad for a specified user. Returns an HTTP 404 error if the user does not exist, if the app does not exist, or if a targetted ad could not be found for the user.

  • access: public
void getAd (string $user_id, string $format, [integer $width = null], [float $lat = null], [float $long = null], [string $lang = null], [string $jsonp = null])
  • string $user_id: Required. The screen name or id of the user on Twitter.
  • string $format: Required. Response format, one of Api140Proof::HTML, Api140Proof::JS, Api140Proof::JSON, or Api140Proof::XML
  • integer $width: Required (html format only). The width, in pixels, of the requested ad unit. Possible values: 240 (Api140Proof::TINY), 320 (Api140Proof::SMALL), 480 (Api140Proof::MEDIUM), 640 (Api140Proof::LARGE), or 960 (Api140Proof::EXTRA_LARGE)
  • float $lat: Optional. The user's current latitude. Note: The valid ranges for latitude is -90.0 to +90.0 (North is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, or if there not a corresponding long parameter with this request.
  • float $long: Optional. The user's current longitude. Note: The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, or if there not a corresponding lat parameter with this request.
  • string $lang: Optional. Restricts ads to the given language, specified by an ISO 639-1 code.
  • string $jsonp: Optional. Specify the name of a callback function for a js response.
Constructor __construct (line 51)
  • access: public
Api140Proof __construct ( $app_id, [string $api_base = self::API_BASE], string $api_id)
  • string $api_id: Required. Your 140 Proof API ID
  • string $api_base: Optional. Base URL for 140 Proof API (defaults to production)
  • $app_id
Class Constants
ADS_USER = "/ads/user" (line 14)
API_BASE = "http://api.140proof.com" (line 13)
DEFAULT_LANG = "en" (line 37)
DELETE = "DELETE" (line 35)
EXTRA_LARGE = "960" (line 30)
GET = "GET" (line 32)
HTML = "html" (line 16)
HTML_TYPE = 'text/html' (line 21)
JS = "js" (line 17)
JSON = "json" (line 18)
JSON_TYPE = 'application/json' (line 23)
JS_TYPE = 'application/javascript' (line 22)
LARGE = "640" (line 29)
MEDIUM = "480" (line 28)
POST = "POST" (line 33)
PUT = "PUT" (line 34)
SMALL = "320" (line 27)
TINY = "240" (line 26)
XML = "xml" (line 19)
XML_TYPE = 'text/xml' (line 24)

Documentation generated on Thu, 18 Nov 2010 20:21:00 -0500 by phpDocumentor 1.4.3