Hey,
can you tell me, where and how I have to adjust my timestamps?
So, I found out that my system time is 2 hours (7200 seconds) later than Twitter’s server time.
Then, in OAuth.php I changed the function:
private static function generate_timestamp() {
return time()-7200;
}
But there is still a 401 error. I did a print_r($twitteroauth):
TwitterOAuth Object ( [http_code] => 401 [url] => https://api.twitter.com/oauth/request_token?oauth_callback=http%3A%2F%2Flocalhost.com%2Ftwitter_oauth.php&oauth_consumer_key=YOUR_CONSUMER_KEY&oauth_nonce=4aa1e48d49d6e7c1cd29fe6d56177e6d&oauth_signature=R4CGaWla%2BDXZyZvEy9zn5AmD9wA%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1336677397&oauth_version=1.0 [host] => https://api.twitter.com/1/ [timeout] => 30 [connecttimeout] => 30 [ssl_verifypeer] => [format] => json [decode_json] => 1 [http_info] => Array ( [url] => https://api.twitter.com/oauth/request_token?oauth_callback=http%3A%2F%2Flocalhost.com%2Ftwitter_oauth.php&oauth_consumer_key=YOUR_CONSUMER_KEY&oauth_nonce=4aa1e48d49d6e7c1cd29fe6d56177e6d&oauth_signature=R4CGaWla%2BDXZyZvEy9zn5AmD9wA%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1336677397&oauth_version=1.0 [content_type] => text/html; charset=utf-8 [http_code] => 401 [header_size] => 1007 [request_size] => 383 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.749927 [namelookup_time] => 0.020939 [connect_time] => 0.192984 [pretransfer_time] => 0.546367 [size_upload] => 0 [size_download] => 44 [speed_download] => 58 [speed_upload] => 0 [download_content_length] => 44 [upload_content_length] => 0 [starttransfer_time] => 0.749661 [redirect_time] => 0 [certinfo] => Array ( ) ) [useragent] => TwitterOAuth v0.2.0-beta2 [sha1_method] => OAuthSignatureMethod_HMAC_SHA1 Object ( ) [consumer] => OAuthConsumer Object ( [key] => YOUR_CONSUMER_KEY [secret] => YOUR_CONSUMER_SECRET [callback_url] => ) [token] => OAuthConsumer Object ( [key] => [secret] => [callback_url] => ) [http_header] => Array ( [date] => Thu, 10 May 2012 21:16:37 GMT [status] => 401 Unauthorized [cache_control] => no-cache, no-store, must-revalidate, pre-check=0, post-check=0 [expires] => Tue, 31 Mar 1981 05:00:00 GMT [x_frame_options] => SAMEORIGIN [x_mid] => 03dd10643046a5224f77eb09e3d711b0622fff2d [last_modified] => Thu, 10 May 2012 21:16:37 GMT [content_length] => 44 [x_transaction] => 5e13a55124acec3c [content_type] => text/html; charset=utf-8 [x_runtime] => 0.01498 [pragma] => no-cache [set_cookie] => _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCNNSnDg3ASIKZmxhc2hJQzonQWN0aW9uQ29u%250AdHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoHaWQiJWYz%250AMTM3YTRkODgwZjljYjA3Y2EyNDI4YzgyNTMxMGUz–28c7efc422f3071cedc5d7ecc65f4fcf8a9503e7; domain=.twitter.com; path=/; HttpOnly [vary] => Accept-Encoding [server] => tfe ) )
And my system timestamp was: 1336684598
Do you have an idea what to do now?