My Twitter php script stopped working!
I'm using this PHP class for a Twitter script:
twitter.slawcup.com/twitter.class.phps
The script is:
$t= new twitter();
$t->username='someuser';
$t->password='somepass';
$res = $t->update($tweet);
if($res===false){
echo "ERROR<hr/>";
echo "<pre>";
print_r($t->responseInfo);
echo "</pre>";
}else{
echo "SUCCESS<hr/>Status Posted";
}
Where the variable $tweet is a string generated before.
It worked ok un until june 8th, and then it just died.
Now, when I run the code, it gives me:
ERROR
Array
(
[url] => http://twitter.com/statuses/update.xml
[content_type] => application/xml; charset=utf-8
[http_code] => 400
[header_size] => 1096
[request_size] => 120
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
开发者_开发百科 [total_time] => 0.11795
[namelookup_time] => 3.3E-5
[connect_time] => 0.014397
[pretransfer_time] => 0.014405
[size_upload] => 0
[size_download] => 148
[speed_download] => 1254
[speed_upload] => 0
[download_content_length] => 148
[upload_content_length] => 0
[starttransfer_time] => 0.117829
[redirect_time] => 0
)
What could be wrong? It's specially weird because it was working ok, and then it stopped.
It's returning Error Code 400 if you check out http://en.wikipedia.org/wiki/List_of_HTTP_status_codes the error code says
Bad Request
The request contains bad syntax or cannot be fulfilled.
This would relate to something wrong with the class... but it is hard to see without checking code.
##Make sure you have the lastest version of the class.##
What authentication schema are you using? Twitter will deprecate support for auth-basic, even if it still works, i'd consider migrating to Oauth soon.
Solved. It was my hosting provider's fault. PHP was not properly set up.
精彩评论