php How to make a right twitter api curl with oauth php How to make a right twitter api curl with oauth curl curl

php How to make a right twitter api curl with oauth


You're using mktime incorrectly, it doesn't accept a date string. Instead of that however, I'd recommend that you do ...

$time = time() - 86400;

With regards to your other questions, I recommend getting an oauth capable twitter library for PHP. There are plenty out there, and there's no point in reinventing the wheel ... usually :)

https://dev.twitter.com/docs/auth/oauth/single-user-with-examples


Also, check that you're time/date are properly set on your server. Twitter will throw an out of bounds error if your timestamp is off by more than ~24 hours.

Guide for setting date/time on linux - http://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/