I can't tweet via oauth


#1
<?php require_once('twitteroauth.php'); $connection = new TwitterOAuth('*********', '***********','**************','**********'); $connection->post('statuses/update', array('status' => 'text to be tweeted')); ?>

this is my php file, in the same folder i have twitteroaut.php and oauth.php. I uploaded these files to my website but nothing happens when i open it.


#2
<?php /** * post_tweet.php * Example of posting a tweet with OAuth * @author Adam Green <140dev@gmail.com> * @license GNU Public License */

$tweet_text = ‘Hello Twitter’;
print “Posting…\n”;
$result = post_tweet($tweet_text);
print "Response code: " . $result . “\n”;

function post_tweet($tweet_text) {

// Use Matt Harris’ OAuth library to make the connection
// This lives at: https://github.com/themattharris/tmhOAuth
require_once(‘tmhoauth/tmhOAuth.php’);

// Set the authorization values
// In keeping with the OAuth tradition of maximum confusion,
// the names of some of these values are different from the Twitter Dev interface
// user_token is called Access Token on the Dev site
// user_secret is called Access Token Secret on the Dev site
// The values here have asterisks to hide the true contents
// You need to use the actual values from your Twitter app
$connection = new tmhOAuth(array(
‘consumer_key’ => ‘******’,
‘consumer_secret’ => ‘******’,
‘user_token’ => ‘******’,
‘user_secret’ => ‘******’,
));

// Make the API call
$connection->request(‘POST’,
$connection->url(‘1/statuses/update’),
array(‘status’ => $tweet_text));

return $connection->response[‘code’];
}
?>

//Hope it will help you


#3

Hello, I have made the same thing what you have said and i got Posting… Response code: 410 the tweet message is not appearing on my twitter account. Please help me how can i solve the issue.