php twitter post image not going - working

时间:2014-09-13 10:02:40

标签: php twitter

我试图在Twitter上发送带有图片的状态。状态会成功发布,但图像不会显示。这是为什么?

我的代码有错误吗?状态确实成功更新。

require_once 'twitteroauth.php';


$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$content = $connection->get('account/verify_credentials');
$image = 'logo.png';
$connection->post('statuses/update', 
    array(
        'media[]'  => "@{$image};type=image/jpeg;filename={$image}",
        'status'   => 'message text written here',
    ),
    true, // use auth
    true  // multipart
); 

0 个答案:

没有答案
相关问题