themattharris / tmhOAuth

An OAuth 1.0A library written in PHP
Apache License 2.0
857 stars 335 forks source link

401 Error #174

Closed CarlaMck77 closed 10 years ago

CarlaMck77 commented 10 years ago

This code has worked for me in the past. Just wondering what has changed to make the twitter feed stop on my website.

On inspection, I received an Error Code: 401. I also saw a message stating "Timestamp out of bounds".

I have not changed the server I am on. Neither is there a time issue on my server.

[code] => 401 [response] => {"errors":[{"message":"Timestamp out of bounds","code":135}]}

I'm not too sure if I fully described the situation but If more clarity is needed just let me know.

themattharris commented 10 years ago

is this still happening for you? that error tends to mean the clock on your server is incorrectly configured. one way to check this is to print the current time according to your script and comparing it to server time in the headers returned by the Twitter API.

this (https://github.com/themattharris/tmhOAuth-examples/blob/a7e94beadedeb3b67fde82daa7ed95d054332277/auto_fix_time.php) is an old example that needs a little work to behave with the current version of tmhOAuth but it does demonstrate the time comparison check i'm referring to. hope it helps.