确实为update_with_media亚伯拉罕的twitteroauth的图书馆工作?
我使用下面的代码,但它返回我stdClass的对象([请求] => /1/statuses/update_with_media.json [错误] =>错误创建状态)。
session_start();
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
header('Location: ./clearsessions.php');
}
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,$_SESSION['access_token']['oauth_token'], $_SESSION['access_token']['oauth_token_secret']);
$image = './images/5298.png';
$content = $connection->post('statuses/update_with_media',
array(
'media[]' => '@{$image};type=image/jpeg;filename={$image}',
'status' => 'My current location'));
include('html.inc');
任何一个任何想法如何解决这个问题?
编辑1:我使用https://upload.twitter.com/1/作为网址