开发者

Using Input Box to Post onto Twitter

Is it possible to post onto Twitter us开发者_StackOverflowing the sharing URL, for example:

http://twitter.com/home?status=My Status Update

But, instead of creating a link for a user to click, I want to have an input box that will post the content of the input box as the status. So, whatever the user types into the input box would replace My Status Update.

I'm thinking there should be a way to use the form to post onto this URL hxxp://twitter.com/home?status=XXXX where XXXX is the input value. Is this possible?

UPDATE: I realize I described this wrong - it doesn't have to ACTUALLY POST the status, it can take them to Twitter, ask them to logged in (if not, skip), and then put the status update inside the Tweet Box and require the user to press Tweet to send it

Thanks!


No, Twitter require the status to be sent from it's interface.

You can provide the user an option to send status from your site only with twitter application and only after the user authorized your application to sends twits in his account.


Sadly, the solution to this may be more complicated then you think.

Twitter recently switched to full OAuth authentication to interact with their api and to post status updates etc.

In short, to do what you suggest above will require your visitors to log in.

To simplify this, on my websites I use the Official Twitter Tweet Button because I feel that my visitors will trust it the most and will enter in their username/pass without worry.

The Official Twitter Tweet Button page has a builder where you can select various options to change the look and content of the tweet itself.

Be sure to checkout the full documentation for the advanced usage examples and the full reference of properties that can be used with the javascript tweet button

p.s.

On my site I registered for an app so I could include the following js file:

<script src="http://platform.twitter.com/anywhere.js?id=MY-APP-ID&amp;v=1"></script>

And my links look something like this:

<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://mydomain.com/url-to-post" data-text="Text that will actually be tweeted" data-count="horizontal" data-via="mytwitteraccount">Tweet</a>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜