所以基本上我试图用Twitter API发送推文。我使用的是OAuth API。这是我的代码:
$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);
它有效...但是...如果我在我的推文中加上一个标签,例如
$tweet = "Here is a #second test";
然后在#之前切断。为什么?如何防止?
提前谢谢