class JTwitterProfile extends JTwitterObject

Twitter API Profile class for the Joomla Platform.

Methods

__construct( Registry $options = null, JHttp $client = null, JTwitterOAuth $oauth = null)

Constructor.

void
checkRateLimit( string $resource = null, string $action = null)

Method to check the rate limit for the requesting IP address

string
fetchUrl( string $path, array $parameters = null)

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

array
getRateLimit( string $resource)

Method to retrieve the rate limit for the requesting IP address

array
sendRequest( string $path, string $method = 'GET', mixed $data = array(), array $headers = array())

Method to send the request.

mixed
getOption( string $key)

Get an option from the JTwitterObject instance.

setOption( string $key, mixed $value)

Set an option for the JTwitterObject instance.

array
updateProfile( string $name = null, string $url = null, string $location = null, string $description = null, boolean $entities = null, boolean $skip_status = null)

Method to et values that users are able to set under the "Account" tab of their settings page.

array
updateProfileBackgroundImage( string $image = null, boolean $tile = false, boolean $entities = null, boolean $skip_status = null, boolean $use = false)

Method to update the authenticating user's profile background image. This method can also be used to enable or disable the profile background image.

array
updateProfileImage( string $image = null, boolean $entities = null, boolean $skip_status = null)

Method to update the authenticating user's profile image.

array
updateProfileColors( string $background = null, string $link = null, string $sidebar_border = null, string $sidebar_fill = null, string $text = null, boolean $entities = null, boolean $skip_status = null)

Method to set one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.

array
getSettings()

Method to get the settings (including current trend, geo and sleep time information) for the authenticating user.

array
updateSettings( integer $location = null, boolean $sleep_time = false, integer $start_sleep = null, integer $end_sleep = null, string $time_zone = null, string $lang = null)

Method to update the authenticating user's settings.

Details

__construct( Registry $options = null, JHttp $client = null, JTwitterOAuth $oauth = null)

Constructor.

Parameters

Registry $options &$options Twitter options object.
JHttp $client The HTTP client object.
JTwitterOAuth $oauth The OAuth client.

void checkRateLimit( string $resource = null, string $action = null)

Method to check the rate limit for the requesting IP address

Parameters

string $resource A resource or a comma-separated list of resource families you want to know the current rate limit disposition for.
string $action An action for the specified resource, if only one resource is specified.

Return Value

void

Exceptions

RuntimeException

string fetchUrl( string $path, array $parameters = null)

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

Parameters

string $path URL to inflect
array $parameters The parameters passed in the URL.

Return Value

string The request URL.

array getRateLimit( string $resource)

Method to retrieve the rate limit for the requesting IP address

Parameters

string $resource A resource or a comma-separated list of resource families you want to know the current rate limit disposition for.

Return Value

array The JSON response decoded

array sendRequest( string $path, string $method = 'GET', mixed $data = array(), array $headers = array())

Method to send the request.

Parameters

string $path The path of the request to make
string $method The request method.
mixed $data Either an associative array or a string to be sent with the post request.
array $headers An array of name-value pairs to include in the header of the request

Return Value

array The decoded JSON response

Exceptions

RuntimeException

mixed getOption( string $key)

Get an option from the JTwitterObject instance.

Parameters

string $key The name of the option to get.

Return Value

mixed The option value.

JTwitterObject setOption( string $key, mixed $value)

Set an option for the JTwitterObject instance.

Parameters

string $key The name of the option to set.
mixed $value The option value to set.

Return Value

JTwitterObject This object for method chaining.

array updateProfile( string $name = null, string $url = null, string $location = null, string $description = null, boolean $entities = null, boolean $skip_status = null)

Method to et values that users are able to set under the "Account" tab of their settings page.

Parameters

string $name Full name associated with the profile. Maximum of 20 characters.
string $url URL associated with the profile. Will be prepended with "http://" if not present. Maximum of 100 characters.
string $location The city or country describing where the user of the account is located. The contents are not normalized or geocoded in any way. Maximum of 30 characters.
string $description A description of the user owning the account. Maximum of 160 characters.
boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.

Return Value

array The decoded JSON response

array updateProfileBackgroundImage( string $image = null, boolean $tile = false, boolean $entities = null, boolean $skip_status = null, boolean $use = false)

Method to update the authenticating user's profile background image. This method can also be used to enable or disable the profile background image.

Parameters

string $image The background image for the profile.
boolean $tile Whether or not to tile the background image.
boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.
boolean $use Determines whether to display the profile background image or not.

Return Value

array The decoded JSON response

array updateProfileImage( string $image = null, boolean $entities = null, boolean $skip_status = null)

Method to update the authenticating user's profile image.

Parameters

string $image The background image for the profile.
boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.

Return Value

array The decoded JSON response

array updateProfileColors( string $background = null, string $link = null, string $sidebar_border = null, string $sidebar_fill = null, string $text = null, boolean $entities = null, boolean $skip_status = null)

Method to set one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.

Parameters

string $background Profile background color.
string $link Profile link color.
string $sidebar_border Profile sidebar's border color.
string $sidebar_fill Profile sidebar's fill color.
string $text Profile text color.
boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.

Return Value

array The decoded JSON response

array getSettings()

Method to get the settings (including current trend, geo and sleep time information) for the authenticating user.

Return Value

array The decoded JSON response

array updateSettings( integer $location = null, boolean $sleep_time = false, integer $start_sleep = null, integer $end_sleep = null, string $time_zone = null, string $lang = null)

Method to update the authenticating user's settings.

Parameters

integer $location The Yahoo! Where On Earth ID to use as the user's default trend location.
boolean $sleep_time When set to true, t or 1, will enable sleep time for the user.
integer $start_sleep The hour that sleep time should begin if it is enabled.
integer $end_sleep The hour that sleep time should end if it is enabled.
string $time_zone The timezone dates and times should be displayed in for the user. The timezone must be one of the Rails TimeZone names.
string $lang The language which Twitter should render in for this user.

Return Value

array The decoded JSON response