Hi,
I spent over 6 hours for trying to add the ability to post on twitter from my website using the OAuth system.
The simple code that I used goes like this:
require_once ‘./lib/twitteroauth/twitteroauth.php’;
define(“CONSUMER_KEY”, “XXX”);
define(“CONSUMER_SECRET”, “XXX”);
define(“OAUTH_TOKEN”, “XXX”);
define(“OAUTH_SECRET”, “XXX”);
$text = ‘Using Abrahms Twitter OAuth library – and loving it!’;
$tweet = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$tweet->post(‘statuses/update.json’, array(‘status’ => $text));
When I run the PHP file, nothing happens, I mean the code does doing something, but I don’t see the twiit on my wall.
First of all, everything I tried to find on google or twitter blogs was pretty out of date. The most frehs topic was like the end of 2011 or the begining of 2012.
I have no idea if “‘statuses/update.json’” is correct like, and I have no idea how make it work.
If someone knows an alternative solution or how to fix it, please let me know.
Thanks.