You are here

function twitter_fetch_friends in Twitter 6.2

Fetch information about Twitter.com accounts followed by a given user.

This function does not require authentication. It is mostly useful for mining information about connections, and locating existing Twitter friends who have signed up for the same Drupal site.

Parameters

$screen_name: The screen name of a Twitter.com user.

Return value

An array of Twitter accounts.

See also

twitter_fetch_followers()

File

./twitter.inc, line 260
A wrapper API for the Twitter microblogging service.

Code

function twitter_fetch_friends($screen_name) {
  $url = "http://" . variable_get('twitter_api_url', 'twitter.com') . "/statuses/friends/{$screen_name}.xml";
  $results = drupal_http_request($url, array(), 'GET');
  if (_twitter_request_failure($results)) {
    return array();
  }
  return _twitter_convert_xml_to_array($results->data);
}