Is it possible to open a Twitter dialog page to send direct messages, in the same way that one can share something on Twitter by launching this url:
http://www.twitter.com/share/?text=hello+this+is+a+test+message&url=
I would like to avoid having to use the Twitter API (with api key) if possible for this project, but after searching around I'm getting the feeling I have n开发者_Go百科o choice.
Thanks!
There are a couple of ways to accomplish this.
Create an empty official DM dialog. It does not appear to support pre filling with text: https://twitter.com/#!/direct_messages/create/twitter
Load the full Twitter homepage with pre filled text. Uses the sms shorthand for sending a DM: https://twitter.com/home?status=d+twitter+msg+goes+here
Load the new Intent interface with pre filled text using the SMS shorthand: https://twitter.com/intent/tweet/complete?text=d+twitter+msg+goes+here
<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>
Will bring up a tweet dialogue with specified your_text and your_url.
I'm not sure of a URL to use, but there are sites that provide the service like http://twitterdmer.com/ and http://www.socialoomph.com/
Twitter's interface allows for sending direct messages by using either of these formats:
D <username> <text>
M <username> <text>
Read more: https://dev.twitter.com/docs/faq#6521
精彩评论