我写了可以改变 Twitter 状态的代码,但是很遗憾这个代码无法发布图片。
请检查我的代码并帮助我在发布文字的同时发布图片。
$consumerKey = '';
$consumerSecret = '';
$oAuthToken = '';
$oAuthSecret = '';
include "OAuth.php";
include "twitteroauth.php";
require_once('twitteroauth.php');
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
$tweet->post('statuses/update', array('status' => 'PHP --> example.co.uk <-- ', 'media[]' => "http://www.balanced-hr.com/wp- content/uploads/2014/08/majster.jpg"));
echo "your message has been sent to twitter API";