开发者

Twitter PHP - URL not encoded in tweet

开发者 https://www.devze.com 2023-04-08 14:26 出处:网络
I\'m trying to post to Twitter using the Twitter PHP SDK twitter-async my tweets include a URL in them that doesn\'t seem to be getting encoded. How can I make the URLs show properly when tweeted?

I'm trying to post to Twitter using the Twitter PHP SDK twitter-async my tweets include a URL in them that doesn't seem to be getting encoded. How can I make the URLs show properly when tweeted?

I call this function in the SDK

function postTweet($tweet) {
  $this->twitterObj->post('/statuses/update.json', arra开发者_运维知识库y('status' => $tweet));            
}

There's not much to it really.


In the end it was simply an issue with Twitter not recognizing my local URL as an url, when I tested changing to my production site it worked fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号