1
我嘗試使用php在Twitter上發佈媒體。我可以發佈推文,但圖片沒有看到。你可以幫幫我嗎?Php Twitter Post Image
<?php
require_once('TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'oauth_access_token' => "",
'oauth_access_token_secret' => "",
'consumer_key' => "",
'consumer_secret' => ""
);
$media_id = '847072976486858753';
$url = "https://api.twitter.com/1.1/statuses/update.json";
$twitter = new TwitterAPIExchange($settings);
$requestMethod = 'POST';
$response = $twitter->setPostfields(
array('status' => 'Test Tweet', 'media_ids' => $media_id)
)->buildOauth($url, $requestMethod)
->performRequest();
?>
update_with_media端點已折舊。 –