Class RLPlurkAPI

Description

This is an unofficial PHP Plurk API provided by Ryan Lim.

PHP version 5

Located in /RLPlurkAPI.php (line 104)


	
			
Variable Summary
array $friends
array $http_client
string $nick_name
array $plurk_paths
int $uid
Method Summary
static array dejsonize (string $data)
static string getPermalink (int $plurk_id)
static int permalinkToPlurkID (string $string_permalink)
RLPlurkAPI __construct ()
bool addPlurk ([string $string_lang = 'en'], [string $string_qualifier = 'says'], [string $string_content = ''], [bool $allow_comments = true], [array $array_limited_to = array()])
bool befriend (array $array_uid, bool $bool_befriend)
bool blockUser (array $array_uid)
bool deletePlurk (array $int_plurk_id)
bool denyFriendMakeFan (array $array_uid)
mixed getAlerts ()
array getBlockedUsers ()
array getCities ([int $int_uid = null], [int $int_region_id = null])
array getCountries ([int $int_uid = null])
array getGlobalPlurks ([int $int_uid = null], [string $date_from = null], [string $date_offset = null], [int $country_id = null], [int $region_id = null], [int $city_id = null], [bool $fetch_responses = false])
array getPlurks ([int $int_uid = null], [string $date_from = null], [string $date_offset = null], [bool $fetch_responses = false])
array getRegions ([int $int_uid = null], [int $int_country_id = null])
array getResponses (int $int_plurk_id)
array getUnreadPlurks ([bool $fetch_responses = false])
bool isLoggedIn ()
bool login (string $nick_name, string $password)
bool mutePlurk (array $int_plurk_id, bool $bool_setmute)
int nicknameToUid (string $string_nick_name)
mixed respondToPlurk (int $int_plurk_id, string $string_lang, string $string_qualifier, string $string_content)
string uidToNickname (int $uid)
array uidToUserinfo (int $int_uid)
bool unblockUser (array $array_uid)
Variables
bool $bool_login = false (line 155)

Are we logged in?

  • access: protected
array $friends = array() (line 173)

The associative array of friend uids => nick_names

  • access: public
array $http_client = null (line 117)

The http client object used to make http requests

  • access: protected
array $http_options = array() (line 111)

The http options that we provide to the http methods.

  • access: protected
string $nick_name = '' (line 167)

Our Plurk nick name.

  • access: public
array $plurk_paths = array(
'http_base' => 'http://www.plurk.com',
'login' =>
'http://www.plurk.com/Users/login?redirect_page=main',
'getCompletion' => 'http://www.plurk.com/Users/getCompletion',
'plurk_add' => 'http://www.plurk.com/TimeLine/addPlurk',
'plurk_respond' => 'http://www.plurk.com/Responses/add',
'plurk_get' => 'http://www.plurk.com/TimeLine/getPlurks',
'plurk_get_responses' => 'http://www.plurk.com/Responses/get2',
'plurk_get_unread' => 'http://www.plurk.com/TimeLine/getUnreadPlurks',
'plurk_get_global' => 'http://www.plurk.com/TimeLine/getGlobalPlurks',
'plurk_mute' => 'http://www.plurk.com/TimeLine/setMutePlurk',
'plurk_delete' => 'http://www.plurk.com/TimeLine/deletePlurk',
'notification' => 'http://www.plurk.com/Notifications',
'notification_accept' => 'http://www.plurk.com/Notifications/allow',
'notification_makefan' =>
'http://www.plurk.com/Notifications/allowDontFollow',
'notification_deny' => 'http://www.plurk.com/Notifications/deny',
'friends_get' => 'http://www.plurk.com/Users/getFriends',
'friends_block' => 'http://www.plurk.com/Friends/blockUser',
'friends_remove_block' => 'http://www.plurk.com/Friends/removeBlock',
'friends_get_blocked' => 'http://www.plurk.com/Friends/getBlockedByOffset',
'user_get_info' => 'http://www.plurk.com/Users/fetchUserInfo',
'get_countries' => 'http://www.plurk.com/Geo/getCountries',
'get_regions' => 'http://www.plurk.com/Geo/getRegions',
'get_cities' => 'http://www.plurk.com/Geo/getCities'
)
(line 123)

The plurk URL paths that we can use.

  • access: protected
int $uid = -1 (line 161)

Our Plurk uid.

  • access: public
Methods
static method dejsonize (line 276)

Parse the Plurk JSON string into an array.

  • return: The array (numeric) array of plurks (an associative subarray).
  • access: public
static array dejsonize (string $data)
  • string $data: The array of json data (must be surrounded by '[' and ']').
static method getPermalink (line 1065)

Convert a plurk ID to a permalink URL.

  • return: The permalink URL address.
  • access: public
static string getPermalink (int $plurk_id)
  • int $plurk_id: The plurk ID number.
static method permalinkToPlurkID (line 1081)

Convert a plurk permalink URL address to a plurk ID.

  • return: The plurk ID number.
  • access: public
static int permalinkToPlurkID (string $string_permalink)
  • string $string_permalink: The plurk permalink URL address.
Constructor __construct (line 178)

Constructor.

RLPlurkAPI __construct ()
addPlurk (line 353)

Add a new plurk.

  • return: true if it was posted, false otherwise.
bool addPlurk ([string $string_lang = 'en'], [string $string_qualifier = 'says'], [string $string_content = ''], [bool $allow_comments = true], [array $array_limited_to = array()])
  • string $string_lang: The plurk language.
  • string $string_qualifier: The plurk qualifier.
  • string $string_content: The content of the plurk to be posted.
  • bool $allow_comments: true if this plurk allows comments, false otherwise.
  • array $array_limited_to: The array of uids this plurk is visible to. If this array is of size 0, it is visible to everyone.
befriend (line 469)

Befriend or decline a friend request.

  • return: Returns true if successful or false otherwise.
bool befriend (array $array_uid, bool $bool_befriend)
  • array $array_uid: The array of friend uids.
  • bool $bool_befriend: If true, accept friend requests, decline otherwise.
blockUser (line 535)

Block users.

  • return: Returns true if successful or false otherwise.
bool blockUser (array $array_uid)
  • array $array_uid: The array of user ids to be blocked.
deletePlurk (line 646)

Deletes a plurks.

  • return: Returns true if successful or false otherwise.
bool deletePlurk (array $int_plurk_id)
  • array $int_plurk_id: The plurk id to be deleted.
denyFriendMakeFan (line 507)

Decline a friend request but make as friend instead.

  • return: Returns true if successful or false otherwise.
bool denyFriendMakeFan (array $array_uid)
  • array $array_uid: The array of friend requests uids.
getAlerts (line 440)

Get alert notification for friend requests.

  • return: false on error(s), otherwise an array of friend uids.
mixed getAlerts ()
getBlockedUsers (line 589)

Get my list of blocked users.

  • return: Returns an array of blocked users.
array getBlockedUsers ()
getCities (line 1172)

Get cities.

  • return: The associative array of cities within a region and their details.
array getCities ([int $int_uid = null], [int $int_region_id = null])
  • int $int_uid: The user's UID to be passed to the getCities.
  • int $int_region_id: The region's ID to be passed to the getCities.
getCountries (line 1096)

Get thie list of countries.

  • return: The associative array of countries and their details.
array getCountries ([int $int_uid = null])
  • int $int_uid: The user's UID to be passed to the getCountries.
getGlobalPlurks (line 795)

Gets Global plurks (browse). Only 25 plurks are fetched at a time as this is limited on the server.

The array returned is ordered most recent post first followed by previous posts.

  • return: The array (numerical) of plurks (an associative subarray).
array getGlobalPlurks ([int $int_uid = null], [string $date_from = null], [string $date_offset = null], [int $country_id = null], [int $region_id = null], [int $city_id = null], [bool $fetch_responses = false])
  • int $int_uid: The UID to fetch plurks for. (not required)
  • string $date_from: The date/time to start fetching plurks. This must be in the <yyyy-mm-dd>T<hh:mm:ss> format assumed to be UTC time.
  • string $date_offset: The date/time offset that fetches plurks earlier than this offset. The format is the same as $date_from.
  • int $country_id: Country ID to get results from.
  • int $region_id: Region ID to get results from. Takes precedence over Country ID.
  • int $city_id: City ID to get results from. Takes precedence over Country ID and Region ID.
  • bool $fetch_responses: If true, populate the responses_fetch value with the array of responses.
getPlurks (line 684)

Gets the plurks for the user. Only 25 plurks are fetch at a time as this is limited on the server.

The array returned is ordered most recent post first followed by previous posts.

  • return: The array (numerical) of plurks (an associative subarray).
array getPlurks ([int $int_uid = null], [string $date_from = null], [string $date_offset = null], [bool $fetch_responses = false])
  • int $int_uid: The UID to fetch plurks for.
  • string $date_from: The date/time to start fetching plurks. This must be in the <yyyy-mm-dd>T<hh:mm:ss> format assumed to be UTC time.
  • string $date_offset: The date/time offset that fetches plurks earlier than this offset. The format is the same as $date_from.
  • bool $fetch_responses: If true, populate the responses_fetch value with the array of responses.
getRegions (line 1130)

Get the regions in a given country.

  • return: The associative array of regions in a country and their details.
array getRegions ([int $int_uid = null], [int $int_country_id = null])
  • int $int_uid: The user's UID to be passed to the getRegions.
  • int $int_country_id: The country's ID to be passed to the getRegions.
getResponses (line 956)

Get the responses of a plurk. This method will load "temporary" friends who have responded to the plurk.

  • return: The array of responses.
array getResponses (int $int_plurk_id)
  • int $int_plurk_id: The plurk ID
getUnreadPlurks (line 745)

Get the unread plurks.

  • return: The array (numerical) of unread plurks (an associative subarray).
array getUnreadPlurks ([bool $fetch_responses = false])
  • bool $fetch_responses: If true, populate the responses_fetch value with the array of responses.
isLoggedIn (line 262)

Are we logged in?

  • return: true if we are logged in, false otherwise.
bool isLoggedIn ()
login (line 199)

Login to Plurk.

  • return: true if login was successful, false otherwise.
bool login (string $nick_name, string $password)
  • string $nick_name: The nickname of the user to login as.
  • string $password: The password for this user.
mutePlurk (line 612)

Mute or unmute plurks

  • return: Returns true if successful or false otherwise.
bool mutePlurk (array $int_plurk_id, bool $bool_setmute)
  • array $int_plurk_id: The plurk id to be muted/unmuted.
  • bool $bool_setmute: If true, this plurk is to be muted, else, unmute it.
nicknameToUid (line 1013)

Retrieve a user's uid from given his/her plurk nick name.

  • return: The uid of the given nickname.
int nicknameToUid (string $string_nick_name)
  • string $string_nick_name: The nickname of the user to retrieve the uid from.
respondToPlurk (line 898)

Respond to a plurk.

  • return: false on failure, otherwise the http response from plurk.
mixed respondToPlurk (int $int_plurk_id, string $string_lang, string $string_qualifier, string $string_content)
  • int $int_plurk_id: The plurk ID number to respond to.
  • string $string_lang: The plurk language.
  • string $string_qualifier: The qualifier to use for this response.
  • string $string_content: The content to be posted as a reply.
uidToNickname (line 865)

Translates a uid to the corresponding nickname.

  • return: The nick_name corresponding to the given uid.
string uidToNickname (int $uid)
  • int $uid: The uid to be translated.
uidToUserinfo (line 1038)

Retrieve a user's information given a plurk uid.

  • return: The associative array of user information.
array uidToUserinfo (int $int_uid)
  • int $int_uid: The uid of the plurk member.
unblockUser (line 563)

Remove blocked users.

  • return: Returns true if successful or false otherwise.
bool unblockUser (array $array_uid)
  • array $array_uid: The array of user ids to be unblocked.

Documentation generated on Mon, 18 Aug 2008 10:35:31 -0500 by phpDocumentor 1.4.2