admin管理员组

文章数量:1318564

Is there a way to create a client side tweet using javascript, a textbox, and a submit button? The process would be to enter text to tweet into the textbox, press the button then tweet it using an authenticated account all on the client side.

Is there a way to create a client side tweet using javascript, a textbox, and a submit button? The process would be to enter text to tweet into the textbox, press the button then tweet it using an authenticated account all on the client side.

Share Improve this question asked May 9, 2011 at 5:36 locoboylocoboy 39k73 gold badges188 silver badges263 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 5

"Yes".

That said, you need to get an authenticated account on the client side. Twitter does expose mostly RESTful API's for all sorts of things including submitting tweets which you would be able to access via AJAX, however the act of logging in may be difficult due to Twitters reliance on OAuth as a login mechanism. I'm not sure how you could get around that in a totally client-side manner.

I know this isn't exactly what you're asking for, but you can also have users post to Twitter like this:

<a href="http://twitter./home?status=Custom%20status%20here" target="_blank">Post to Twitter!</a>

I found the best solution for me was to reference http://twitter./share on a client side button or anchor tag and use twitter to log-in log-out. Granted the downside is I don't get to customize my look and feel of the input (except for the words that I can default set), but it's the only way I could find the client side to work without OAuth.

<a href="http://twitter./share?url=&" target="_blank">Create a Tweet</a>

Any other ways where I can enable more flexibility in my design are wele.

You can use Twitter's @anywhere using something like this:

        twttr.anywhere(function (T) {
            T.Status.update("Hello World");
        });

More info here: https://dev.twitter./docs/anywhere/wele

本文标签: jqueryTweet using javascriptStack Overflow