开发者

How to post links with the twitter API?

I'm using the twitter API, but when I post links they ar开发者_如何学运维e showing up as text and not links. I haven't been able to find the documentation showing how to post a link that actually works.


If you don't keep the prefix (http://) and just post something like www.google.com, the link won't be picked up.


If the URL contains special characters you need encode it before posting to Twitter so it will be converted to a link:

from urllib import quote
url = quote(url)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜