【发布时间】:2015-03-02 17:30:41
【问题描述】:
是否可以打开 Twitter 对话页面以发送直接消息,就像通过启动此 url 在 Twitter 上分享内容一样:
http://www.twitter.com/share/?text=hello+this+is+a+test+message&url=
如果可能的话,我想避免在这个项目中使用 Twitter API(带有 api 密钥),但是在四处搜索之后,我觉得我别无选择。
谢谢!
【问题讨论】:
是否可以打开 Twitter 对话页面以发送直接消息,就像通过启动此 url 在 Twitter 上分享内容一样:
http://www.twitter.com/share/?text=hello+this+is+a+test+message&url=
如果可能的话,我想避免在这个项目中使用 Twitter API(带有 api 密钥),但是在四处搜索之后,我觉得我别无选择。
谢谢!
【问题讨论】:
有几种方法可以做到这一点。
创建一个空的官方 DM 对话框。它似乎不支持预填充文本: https://twitter.com/#!/direct_messages/create/twitter
加载带有预填充文本的完整 Twitter 主页。使用 sms 简写发送 DM: https://twitter.com/home?status=d+twitter+msg+goes+here
使用 SMS 速记加载带有预填充文本的新 Intent 界面: https://twitter.com/intent/tweet/complete?text=d+twitter+msg+goes+here
【讨论】:
#! 的贬值,URL 现在将是:twitter.com/direct_messages/create/USERNAME
<a rel="nofollow" target="_blank" href="#" onclick="window.open('http://twitter.com/intent/tweet?text=your_text&url=your_url','tweet','height=300,width=550,resizable=1');return false;">tweet this</a>
将弹出一个带有指定 your_text 和 your_url 的推文对话。
【讨论】:
我不确定要使用的 URL,但有些网站提供类似 http://twitterdmer.com/ 和 http://www.socialoomph.com/ 的服务
【讨论】:
Twitter 的界面允许使用以下任一格式发送直接消息:
D <username> <text>
M <username> <text>
【讨论】: