I am using twitter-api-php. I am posting statuses and it works well. The only problem is, when the tweet starts with @username, its returning a blank page. I don't know whats wrong. This problem is not just with me, when googling about it, found another person with same query,
Here is the code I am using to post.
$settings = array(
'oauth_access_token' => "ACCESS_TOKEN",
'oauth_access_token_secret' => "ACCESS_TOKEN_SECRET",
'consumer_key' => CONSUMER_KEY,
'consumer_secret' => CONSUMER_SECRET
);
$url = "https://api.twitter.com/1.1/statuses/update.json";
$str = "@sourabh_bajaj this is a sample tweet";
$requestMethod = 'POST';
$twitter=new TwitterAPIExchange($settings);
echo $twitter->setPostfields(
array(
"trim_user" => 1,
"status" => $str
)
)->buildOauth($url, $requestMethod)->performRequest();
This works well if we remove @sourabh_bajaj from the start of the message.