<?php
// OAuth認証
$user = “ユーザー名”;
$consumer_key = “キー”;
$consumer_secret = “シークレット”;
$access_token = “トークンキー”;
$access_token_secret = “トークンシークレット”;
$tmhOAuth = new tmhOAuth(array(
‘consumer_key’ => $consumer_key,
‘consumer_secret’ => $consumer_secret,
‘user_token’ => $access_token,
‘user_secret’ => $access_token_secret,
‘curl_ssl_verifypeer’ => false,
));
$message=”ほげほげ”;
// 画像付きツイート
$code = $tmhOAuth->request(‘POST’, ‘https://api.twitter.com/1.1/statuses/update_with_media.json’,
array(
‘media[]’ => “@{$image}”,
‘status’ => $message
),
true,
true // multipart/form-data
);
}