You are here

public function Twitter::friendships_update in Twitter 6.5

Same name and namespace in other branches
  1. 7.6 twitter.lib.php \Twitter::friendships_update()
  2. 7.5 twitter.lib.php \Twitter::friendships_update()

Allows one to enable or disable retweets and device notifications from the specified user.

Parameters

mixed $id: The user ID or the screen name.

bool $device: Whether to enable/disable device notifications from the target user.

bool $retweets: Whether to enable/disable retweets from the target user.

See also

https://dev.twitter.com/docs/api/1.1/post/friendships/update

File

./twitter.lib.php, line 805
Integration layer to communicate with the Twitter REST API 1.1. https://dev.twitter.com/docs/api/1.1

Class

Twitter
Primary Twitter API implementation class

Code

public function friendships_update($id, $device = NULL, $retweets = NULL) {
  $params = array();
  if (is_numeric($id)) {
    $params['user_id'] = $id;
  }
  else {
    $params['screen_name'] = $id;
  }
  if ($device !== NULL) {
    $params['device'] = $device;
  }
  if ($retweets !== NULL) {
    $params['retweets'] = $retweets;
  }
  return $this
    ->call('friendships/update', $params, 'POST');
}