Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_ShortUrl_BitLy Class Reference

Public Member Functions

 __construct ($login, $apiKey=null)
 
 setOAuthAccessToken ($accessToken)
 set OAuth credentials
 
 setApiLogin ($login, $apiKey)
 set login credentials
 
 shorten ($url)
 This function shortens long url.
 
 unshorten ($shortenedUrl)
 Reveals target for short URL.
 

Protected Member Functions

 _setAccessParameter ()
 prepare http client
 
 _processRequest ()
 handle bit.ly response
 
- Protected Member Functions inherited from Zend_Service_ShortUrl_AbstractShortener
 _validateUri ($url)
 Checks whether URL to be shortened is valid.
 
 _verifyBaseUri ($shortenedUrl)
 Verifies that the URL has been shortened by this service.
 

Protected Attributes

 $_apiUri = 'http://api.bitly.com'
 
 $_loginName
 
 $_apiKey
 
- Protected Attributes inherited from Zend_Service_ShortUrl_AbstractShortener
 $_baseUri = null
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Service_Abstract
static setHttpClient (Zend_Http_Client $httpClient)
 Sets the HTTP client object to use for retrieving the feeds.
 
static getHttpClient ()
 Gets the HTTP client object.
 
- Static Protected Attributes inherited from Zend_Service_Abstract
static $_httpClient = null
 

Constructor & Destructor Documentation

__construct (   $login,
  $apiKey = null 
)
Parameters
string$loginuser login name or application access token
null | string$apiKeyuser API key

Member Function Documentation

_processRequest ( )
protected

handle bit.ly response

Returns
string
Exceptions
Zend_Service_ShortUrl_Exception
_setAccessParameter ( )
protected

prepare http client

Returns
void
setApiLogin (   $login,
  $apiKey 
)

set login credentials

Parameters
$login
$apiKey
Returns
Zend_Service_ShortUrl_BitLy
setOAuthAccessToken (   $accessToken)

set OAuth credentials

Parameters
$accessToken
Returns
Zend_Service_ShortUrl_BitLy
shorten (   $url)

This function shortens long url.

Parameters
string$urlURL to Shorten
Exceptions
Zend_Service_ShortUrl_Exceptionif bit.ly reports an error
Returns
string Shortened Url

Implements Zend_Service_ShortUrl_Shortener.

unshorten (   $shortenedUrl)

Reveals target for short URL.

Parameters
string$shortenedUrlURL to reveal target of
Exceptions
Zend_Service_ShortUrl_Exceptionif bit.ly reports an error
Returns
string Unshortened Url

Implements Zend_Service_ShortUrl_Shortener.

Member Data Documentation

$_apiKey
protected
$_apiUri = 'http://api.bitly.com'
protected
$_loginName
protected