Tweet clickable links with twitteroauth?

2019-07-23 18:19发布

I'm using twitteroauth from https://github.com/abraham/twitteroauth like this:

 $Twitter = new TwitterOAuth(...);
 $Twitter->post('statuses/update', array('status' => 'click <a href="http://google.com">here</a>'));

Tweeted URLs are shown as plain text and not clickable. How do I post a real Link?

3条回答
乱世女痞
2楼-- · 2019-07-23 18:58

I think it's a Twitter issue, it escapes all HTML code: http://support.twitter.com/entries/13920-frequently-asked-questions#html

查看更多
迷人小祖宗
3楼-- · 2019-07-23 18:59

You don't need <a /> tag to post link to Twitter. Do it like this:

 $Twitter = new TwitterOAuth(...);
 $Twitter->post('statuses/update', array('status' => 'click here: http://google.com'));
查看更多
手持菜刀,她持情操
4楼-- · 2019-07-23 19:04

Have you tried posting the link with out the HTML markup and with http:// - posting http://www.google.com vs www.google.com, I'm using the same API and that seems to work for me, but creating the hyperlink as you would in HTML, doesn't seem to work. And now that that I think of it, I don't know that I've ever run across a hyperlink style link in Twitter or TweetDeck, just URL's that are run through a shortener...

查看更多
登录 后发表回答