You are here

public function Twitter::statuses_update_with_media in Twitter 7.6

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

Creates a Tweet with a picture attached.

Parameters

string $status: The text of the status update (the tweet).

array $media: An array of physical paths of images.

array $params: an array of parameters.

See also

https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media

File

./twitter.lib.php, line 468
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 statuses_update_with_media($status, $media, $params = array()) {
  $params['status'] = $status;
  $params['media[]'] = '@{' . implode(',', $media) . '}';
  $values = $this
    ->call('statuses/statuses/update_with_media', $params, 'POST');

  // @TODO support media at TwitterStatus class.
  $result = FALSE;
  if (!empty($values)) {
    $result = new TwitterStatus($values);
  }
  return $result;
}