public static function sendMessage($message, $media = [], $options = [])
    {
        self::initialize();

        $mediaIds = [];
        foreach ($media as $item) {
            $res = self::request(
                'https://upload.twitter.com/1.1/media/upload.json',
                'POST',
                null,
                ['media' => $item]
            );
            $mediaIds[] = $res->media_id_string;
        }
        return self::request(
            'statuses/update',
            'POST',
            $options + ['status' => $message, 'media_ids' => implode(',', $mediaIds) ?: null]
        );
    }
public static function sendMessage($message, $media = [], $options = [])
    {
        self::initialize();

        $mediaIds = [];
        foreach ($media as $item) {
            $res = self::request(
                'https://upload.twitter.com/1.1/media/upload.json',
                'POST',
                null,
                ['media' => $item]
            );
            $mediaIds[] = $res->media_id_string;
        }
        return self::request(
            'statuses/update',
            'POST',
            $options + ['status' => $message, 'media_ids' => implode(',', $mediaIds) ?: null]
        );
    }
public static function sendMessage ( $ message , $ media = [ ] , $ options = [ ] ) { self :: initialize ( ) ; $ mediaIds = [ ] ; foreach ( $ media as $ item ) { $ res = self :: request ( 'https://upload.twitter.com/1.1/media/upload.json' , 'POST' , null , [ 'media' => $ item ] ) ; $ mediaIds [ ] = $ res -> media_id_string ; } return self :: request ( 'statuses/update' , 'POST' , $ options + [ 'status' => $ message , 'media_ids' => implode ( ',' , $ mediaIds ) ? : null ] ) ; }
Sends message to the Twitter.
@param  string   message encoded in UTF-8
@param  string  path to local media file to be uploaded
@param  array  additional options to send to statuses/update
@return stdClass  see https://dev.twitter.com/rest/reference/post/statuses/update
@throws TwitterException
Sends message to the Twitter .