ユーザー名とパスワードでTwitterのステータスを更新しているときに問題があります。ここでCURLを使ってTwitterのステータスを更新する
コードはそのためです。私はOAuthの(コンシューマキーと他のトークンを使用しての手段)を使用することができないように
$username = 'username';
$password = 'password';
$message = 'Testing';
$url = 'http://twitter.com/statuses/update.xml';
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //basic authentication
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
echo $buffer;
これが唯一のユーザーのためではありません。私はすでにこれを試した:http://www.1stwebdesigner.com/tutorials/how-to-update-twitter-using-php-and-twitter-api/しかし、私は複数のユーザーのユーザー名とパスワードを複数のtwitterのステータスを更新するために渡すことはできません。
私にこれを手伝ってください。
このCURLコードを使用した場合、「基本認証はサポートされていません」というエラーが表示されるので、これを手伝ってください。 – Anjara