Source for file friends.php
Documentation is available at friends.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
defined('JPATH_PLATFORM') or die();
* Twitter API Friends class for the Joomla Platform.
* @package Joomla.Platform
* Method to get an array of user IDs the specified user follows.
* @param mixed $user Either an integer containing the user ID or a string containing the screen name.
* @param integer $cursor Causes the list of connections to be broken into pages of no more than 5000 IDs at a time.
* The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out
* after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."
* @param boolean $string_ids Set to true to return IDs as strings, false to return as integers.
* @param integer $count Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request.
* @return array The decoded JSON response
* @throws RuntimeException
public function getFriendIds($user, $cursor =
null, $string_ids =
null, $count =
0)
// Check the rate limit for remaining hits
// Determine which type of data was passed for $user
$data['user_id'] =
$user;
$data['screen_name'] =
$user;
// We don't have a valid entry
throw
new RuntimeException('The specified username is not in the correct format; must use integer or string');
// Check if cursor is specified
$data['cursor'] =
$cursor;
// Check if string_ids is true
$data['stringify_ids'] =
$string_ids;
// Check if count is specified
$path =
'/friends/ids.json';
* Method to display detailed friend information between two users.
* @param mixed $user_a Either an integer containing the user ID or a string containing the screen name of the first user.
* @param mixed $user_b Either an integer containing the user ID or a string containing the screen name of the second user.
* @return array The decoded JSON response
* @throws RuntimeException
// Check the rate limit for remaining hits
// Determine which type of data was passed for $user_a
$data['source_id'] =
$user_a;
$data['source_screen_name'] =
$user_a;
// We don't have a valid entry
throw
new RuntimeException('The first specified username is not in the correct format; must use integer or string');
// Determine which type of data was passed for $user_b
$data['target_id'] =
$user_b;
$data['target_screen_name'] =
$user_b;
// We don't have a valid entry
throw
new RuntimeException('The second specified username is not in the correct format; must use integer or string');
$path =
'/friendships/show.json';
* Method to get an array of user IDs the specified user is followed by.
* @param mixed $user Either an integer containing the user ID or a string containing the screen name.
* @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned
* is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor
* is provided, a value of -1 will be assumed, which is the first "page."
* @param boolean $string_ids Set to true to return IDs as strings, false to return as integers.
* @param integer $count Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request.
* @return array The decoded JSON response
* @throws RuntimeException
public function getFollowerIds($user, $cursor =
null, $string_ids =
null, $count =
0)
// Check the rate limit for remaining hits
// Determine which type of data was passed for $user
$data['user_id'] =
$user;
$data['screen_name'] =
$user;
// We don't have a valid entry
throw
new RuntimeException('The specified username is not in the correct format; must use integer or string');
$path =
'/followers/ids.json';
// Check if cursor is specified
$data['cursor'] =
$cursor;
// Check if string_ids is specified
$data['stringify_ids'] =
$string_ids;
// Check if count is specified
* Method to determine pending requests to follow the authenticating user.
* @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned
* is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor
* is provided, a value of -1 will be assumed, which is the first "page."
* @param boolean $string_ids Set to true to return IDs as strings, false to return as integers.
* @return array The decoded JSON response
// Check the rate limit for remaining hits
// Check if cursor is specified
$data['cursor'] =
$cursor;
// Check if string_ids is specified
$data['stringify_ids'] =
$string_ids;
$path =
'/friendships/incoming.json';
* Method to determine every protected user for whom the authenticating user has a pending follow request.
* @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned
* is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor
* is provided, a value of -1 will be assumed, which is the first "page."
* @param boolean $string_ids Set to true to return IDs as strings, false to return as integers.
* @return array The decoded JSON response
// Check the rate limit for remaining hits
// Check if cursor is specified
$data['cursor'] =
$cursor;
// Check if string_ids is specified
$data['stringify_ids'] =
$string_ids;
$path =
'/friendships/outgoing.json';
* Allows the authenticating users to follow the user specified in the ID parameter.
* @param mixed $user Either an integer containing the user ID or a string containing the screen name.
* @param boolean $follow Enable notifications for the target user.
* @return array The decoded JSON response
* @throws RuntimeException
public function follow($user, $follow =
false)
// Determine which type of data was passed for $user
$data['user_id'] =
$user;
$data['screen_name'] =
$user;
// We don't have a valid entry
throw
new RuntimeException('The specified username is not in the correct format; must use integer or string');
// Check if follow is true
$data['follow'] =
$follow;
$path =
'/friendships/create.json';
* Allows the authenticating users to unfollow the user specified in the ID parameter.
* @param mixed $user Either an integer containing the user ID or a string containing the screen name.
* @return array The decoded JSON response
* @throws RuntimeException
// Determine which type of data was passed for $user
$data['user_id'] =
$user;
$data['screen_name'] =
$user;
// We don't have a valid entry
throw
new RuntimeException('The specified username is not in the correct format; must use integer or string');
$path =
'/friendships/destroy.json';
* Method to get the relationship of the authenticating user to the comma separated list of up to 100 screen_names or user_ids provided.
* @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request.
* @param string $id A comma separated list of user IDs, up to 100 are allowed in a single request.
* @return array The decoded JSON response
* @throws RuntimeException
// Check the rate limit for remaining hits
// Set user IDs and screen names.
$data['screen_name'] =
$screen_name;
if ($id ==
null &&
$screen_name ==
null)
// We don't have a valid entry
throw
new RuntimeException('You must specify either a comma separated list of screen names, user IDs, or a combination of the two');
$path =
'/friendships/lookup.json';
* Allows one to enable or disable retweets and device notifications from the specified user.
* @param mixed $user Either an integer containing the user ID or a string containing the screen name.
* @param boolean $device Enable/disable device notifications from the target user.
* @param boolean $retweets Enable/disable retweets from the target user.
* @return array The decoded JSON response
* @throws RuntimeException
// Determine which type of data was passed for $user
$data['user_id'] =
$user;
$data['screen_name'] =
$user;
// We don't have a valid entry
throw
new RuntimeException('The specified username is not in the correct format; must use integer or string');
// Check if device is specified.
$data['device'] =
$device;
// Check if retweets is specified.
$data['retweets'] =
$retweets;
$path =
'/friendships/update.json';
* Method to get the user ids that currently authenticated user does not want to see retweets from.
* @param boolean $string_ids Set to true to return IDs as strings, false to return as integers.
* @return array The decoded JSON response
// Check the rate limit for remaining hits
// Check if string_ids is specified
$data['stringify_ids'] =
$string_ids;
$path =
'/friendships/no_retweets/ids.json';
Documentation generated on Tue, 19 Nov 2013 15:03:48 +0100 by phpDocumentor 1.4.3