Auto Post to Twitter is not working


#1

Hi,

I’m trying to make my blog to autopost to twitter, but somehow it is not working.
After the post has been inserted in the database, I’m trying to submit it to twitter using the following code:

require_once($_SERVER[“DOCUMENT_ROOT”] . “/app/inc/twitteroauth.php”);

define("CONSUMER_KEY", "my consumer key");
define("CONSUMER_SECRET", "my consumer secret");
define("OAUTH_TOKEN", "my token");
define("OAUTH_SECRET", "my secret");

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$content = $connection->get('account/verify_credentials');

$connection->post('statuses/update', array('status' => 'Here goes the content from the post')));

But somehow it doesn’t get posted to my twitter account. Am I doing something wrong?
Thanks in advance!