Very simple PHP/cURL script to update a status.

With the curl output set to verbose, I see the connection being made
and a response code of 200 OK.

Unfortunately, my status isn't actually updating and I can't figure
out why. The status message is urlencoded, basic authentication is
successful, and using curl from the command line works just fine.

I even compared the curl request from the command line to that
generated with PHP's libcurl and the results are identical... but no
status update!

Here are my curl bits:

$url = "http://twitter.com/statuses/update.xml";;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, "status=".urlencode($tweet));
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);


Any ideas?

Reply via email to