CommonSense PHP API Library
CommonsenseOauthClient Class Reference

List of all members.

Public Member Functions

 requestTokenURL ()
 accessTokenURL ()
 authorizeURL ()
 lastStatusCode ()
 lastAPICall ()
 __construct ($consumerkey, $consumerSecret, $oauthToken=NULL, $oauthTokenSecret=NULL)
 setResponseFormat ($format)
 getRequestToken ($oauthCallback=NULL)
 getAuthorizeURL ($token, $sid="", $sessionid="")
 getAccessToken ($request)
 getXAuthToken ($username, $password)
 get ($url, $parameters=array())
 post ($url, $parameters=array())
 delete ($url, $parameters=array())
 oAuthRequest ($url, $method, $parameters)
 http ($url, $method, $postFields=NULL)
 getHeader ($ch, $header)

Public Attributes

 $httpCode
 $url
 $host
 $requestTokenUrl
 $authorizeUrl
 $accessTokenUrl
 $timeout = 30
 $connectTimeout = 30
 $sslVerifyPeer = true
 $format = "json"
 $decodeJson = true
 $httpInfo
 $httpHeader
 $userAgent = "CSenseOAuthClient v0.1.4"
 $token

Detailed Description

This class is based on the Abraham Williams' TwitterOAuth class (the first PHP Library to support OAuth for Twitter's REST API). Abraham Williams (abraham@abrah.am)


Constructor & Destructor Documentation

CommonsenseOauthClient::__construct ( consumerkey,
consumerSecret,
oauthToken = NULL,
oauthTokenSecret = NULL 
)

construct TwitterOAuth object

Parameters:
string$consumerkey
string$consumerSecret
string$oauthToken
string$oauthTokenSecret

Member Function Documentation

CommonsenseOauthClient::delete ( url,
parameters = array() 
)

DELETE wrapper for oAuthRequest.

Parameters:
string$url
array$parameters
CommonsenseOauthClient::get ( url,
parameters = array() 
)

GET wrapper for oAuthRequest.

Parameters:
string_type$url
array$parameters
Returns:

Exchange request token and secret for an access token and secret, to sign API calls.

Returns:
array("oauth_token" => "the-access-token", "oauth_token_secret" => "the-access-secret", "user_id" => "9436992", "screen_name" => "abraham")
CommonsenseOauthClient::getAuthorizeURL ( token,
sid = "",
sessionid = "" 
)

Get the authorize URL

Returns:
a string
CommonsenseOauthClient::getHeader ( ch,
header 
)

Get the header info to store.

Parameters:
string$header
CommonsenseOauthClient::getRequestToken ( oauthCallback = NULL)

Get a request_token from Twitter

Returns:
a key/value array containing oauth_token and oauth_token_secret
CommonsenseOauthClient::getXAuthToken ( username,
password 
)

One time exchange of username and password for access token and secret.

Returns:
array("oauth_token" => "the-access-token", "oauth_token_secret" => "the-access-secret", "user_id" => "9436992", "screen_name" => "abraham", "x_auth_expires" => "0")
CommonsenseOauthClient::http ( url,
method,
postFields = NULL 
)

Make an HTTP request

Parameters:
string$url
string$method
boolean$postFields
Returns:
API results
CommonsenseOauthClient::oAuthRequest ( url,
method,
parameters 
)

Format and sign an OAuth / API request.

Parameters:
string$url
string$method
array$parameters
Returns:
CommonsenseOauthClient::post ( url,
parameters = array() 
)

POST wrapper for oAuthRequest.

Parameters:
string$url
array$parameters
Returns:

Member Data Documentation

CommonsenseOauthClient::$accessTokenUrl
CommonsenseOauthClient::$authorizeUrl
CommonsenseOauthClient::$connectTimeout = 30
CommonsenseOauthClient::$decodeJson = true
CommonsenseOauthClient::$format = "json"
CommonsenseOauthClient::$host
CommonsenseOauthClient::$httpCode
CommonsenseOauthClient::$httpHeader
CommonsenseOauthClient::$httpInfo
CommonsenseOauthClient::$requestTokenUrl
CommonsenseOauthClient::$sslVerifyPeer = true
CommonsenseOauthClient::$timeout = 30
CommonsenseOauthClient::$token
CommonsenseOauthClient::$url
CommonsenseOauthClient::$userAgent = "CSenseOAuthClient v0.1.4"

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables