Tweet clickable links with twitteroauth?

允我心安 提交于 2019-12-13 16:40:56

问题


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?


回答1:


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...




回答2:


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'));



回答3:


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



来源:https://stackoverflow.com/questions/8984441/tweet-clickable-links-with-twitteroauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!