Services_Twitter_Uploader
[ class tree: Services_Twitter_Uploader ] [ index: Services_Twitter_Uploader ] [ all elements ]

Class: Services_Twitter_Uploader

Source Location: /Services_Twitter_Uploader-0.1.0/Services/Twitter/Uploader.php

Class Overview


An abstract interface for OAuthUploader Services


Author(s):

Version:

  • Release: 0.1.0

Variables

Methods


Child classes:

Services_Twitter_Uploader_PlixiUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_TwippleUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_MobypictureUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_ImglyUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_PosterousUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_TwitpicUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_TwitgooUploader
implementation OAuthUploader Services
Services_Twitter_Uploader_YfrogUploader
implementation OAuthUploader Services

Inherited Variables

Inherited Methods


Class Details

[line 43]
An abstract interface for OAuthUploader Services


[ Top ]


Class Variables

$apiKey =  null

[line 69]

service api key(some services required)
  • Access: protected

Type:   string


[ Top ]

$lastRequest =  null

[line 112]

  • Var: upload last request object
  • See: HTTP_Request2
  • Access: protected

Type:   HTTP_Request2


[ Top ]

$oauth =  null

[line 76]

  • Var: oauth consumer object
  • See: HTTP_OAuth_Consumer
  • Access: protected

Type:   HTTP_OAuth_Consumer


[ Top ]

$postException =  null

[line 88]

  • Var: event of upload time exception
  • See: HTTP_Request2_Exception
  • Access: protected

Type:   HTTP_Request2_Exception


[ Top ]

$postFile =  null

[line 94]

upload file path
  • Access: protected

Type:   string


[ Top ]

$postMessage =  null

[line 100]

post message
  • Access: protected

Type:   string


[ Top ]

$request =  null

[line 106]

  • Var: upload request object
  • See: HTTP_Request2
  • Access: protected

Type:   HTTP_Request2


[ Top ]

$response =  null

[line 118]

  • Var: upload response object
  • See: HTTP_Request2_Response
  • Access: protected

Type:   HTTP_Request2_Response


[ Top ]

$services = array(
        'imgly',
        'plixi',
        'twipple',
        'twitgoo',
        'twitpic',
        'yfrog',
        'mobypicture',
        'twipl',
        'posterous'
    )

[line 53]

List of supported services
  • Access: protected

Type:   array


[ Top ]

$uploadUrl =  null

[line 81]

  • Var: upload endpoint
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 130]

Services_Twitter_Uploader __construct( [ $oauth = null], [string $apiKey = null], [ $request = null])

Constructor
  • See: HTTP_OAuth_Consumer
  • See: HTTP_Request2
  • Access: public

Overridden in child classes as:

Services_Twitter_Uploader_PlixiUploader::__construct()
Constructor
Services_Twitter_Uploader_MobypictureUploader::__construct()
Constructor
Services_Twitter_Uploader_TwitpicUploader::__construct()
Constructor

Parameters:

HTTP_OAuth_Consumer   $oauth     oauth consumer
string   $apiKey     required for some providers
HTTP_Request2   $request     http request provider

[ Top ]

buildSignature   [line 203]

array buildSignature( string $verify_url)

utility method.

for developers method. don't use end-user

  • Return: signed parameter and signature array
  • See: self::TWITTER_VERIFY_CREDENTIALS_JSON
  • See: self::TWITTER_VERIFY_CREDENTIALS_XML
  • Access: protected

Parameters:

string   $verify_url     Twitter's verify_credentials url.

[ Top ]

factory   [line 289]

Services_Twitter_Uploader factory( string $serviceName, $oauth, [string $apiKey = null], [ $request = null])

create uploader instance method.
  • See: self::$services
  • Throws: Services_Twitter_Uploader_Exception
  • Access: public

Parameters:

string   $serviceName     uploader service name
HTTP_OAuth_Consumer   $oauth     oauth consumer instance
string   $apiKey     apiKey some provider is requred
HTTP_Request2   $request     optional instance of HTTP_Request2

[ Top ]

genVerifyHeader   [line 264]

string genVerifyHeader( string $verify_url)

utility method.

for developers method. don't use end-user if provider is in request based implementation of oauth echo. this method use

  • Return: signed verification url
  • Access: protected
  • Uses: self::buildSignature()
  • Uses: HTTP_OAuth::urlencode()

Parameters:

string   $verify_url     verification url

[ Top ]

genVerifyUrl   [line 240]

string genVerifyUrl( string $verify_url)

utility method.

for developers method. don't use end-user if provider is in request based implemention of oauth echo. this method use

  • Return: signed verify_url to url format
  • Access: protected
  • Uses: self::buildSignature()
  • Uses: HTTP_OAuth::urlencode()

Parameters:

string   $verify_url     the verification url

[ Top ]

postUpload   [line 374]

string postUpload( )

extending classes should implment this method.
  • Return: uploaded url
  • Abstract:
  • Access: protected

Overridden in child classes as:

Services_Twitter_Uploader_PlixiUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_TwippleUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_MobypictureUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_ImglyUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_PosterousUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_TwitpicUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_TwitgooUploader::postUpload()
postUpload implementation
Services_Twitter_Uploader_YfrogUploader::postUpload()
postUpload implementation

[ Top ]

postUploadCheck   [line 319]

string postUploadCheck( [ $response = null], [int $code = 200])

This method is run in each implementation in from postUpload().
  • Return: The response body.
  • Throws: Services_Twitter_Uploader_Exception When the response code doesn't match what is expected.
  • Throws: Services_Twitter_Uploader_Exception
  • Access: protected
  • Uses: self::$postException
  • Uses: self::$response

Parameters:

HTTP_Request2_Response   $response     The response object.
int   $code     The expected response code.

[ Top ]

preUpload   [line 367]

void preUpload( )

extending classes should implement this method.
  • Abstract:
  • Access: protected

Overridden in child classes as:

Services_Twitter_Uploader_PlixiUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_TwippleUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_MobypictureUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_ImglyUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_PosterousUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_TwitpicUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_TwitgooUploader::preUpload()
preUpload implementation
Services_Twitter_Uploader_YfrogUploader::preUpload()
preUpload implementation

[ Top ]

setConsumer   [line 357]

void setConsumer( $oauth)

set an instance of HTTP_OAuth_Consumer
  • Access: protected

Parameters:

HTTP_OAuth_Consumer   $oauth     HTTP_OAuth_Consumer implments class

[ Top ]

setRequest   [line 344]

void setRequest( $request)

set an instance of HTTP_Request2
  • Access: protected

Parameters:

HTTP_Request2   $request     HTTP_Request2 implments class

[ Top ]

upload   [line 160]

string upload( [string $filePath = null], [string $message = null])

upload method.

do not all provider require apikey do not supported send message.


Parameters:

string   $filePath     full path of file to upload to the service
string   $message     message (tweet), only supported by some services

[ Top ]


Documentation generated on Wed, 19 Oct 2011 16:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.