So basically I'm trying to send tweets with Twitter API. I'm using OAuth API. Here is my code :
$tweet = "hey everyone !";
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$request = $connection->post("https://api.twitter.com/1.1/statuses/update.json?status=" . urlencode($tweet));
echo json_encode($request);
And it works... But... if I put a hashtag in my tweet, like for example
$tweet = "Here is a #second test";
Then it gets cut before the #. Why ? How to prevent that ?
Thank you in advance