views:

2575

answers:

4

When using simple request to post to Twitter the messages are signed with "sent from API". Is there a way to change that to the actual name of your application? Is it another post parameter or something else?

+9  A: 

This is covered in the Twitter API FAQ

If you would like tweets from your application to recieve a source parameter, please register an application and implement OAuth authentication. We will automatically include your application as the source for any tweets sent from your application.

John Sheehan
Thanks John. I want user to save the credentials beforehand and not bother with going to any websites to "Accept". Can I do that with OAuth and is there any code examples?(I do have registered app though)
DroidIn.net
Droid, there are several OAuth-related questions already answered on Stack Overflow, many of them Twitter-related, and some of them even appear in the "Related" box on the right side of this very page. Please check those. The comments of an answer aren't the place to cover a topic as big as "How do I use OAuth?"
Rob Kennedy
Rob - I don't need tutorial in OAuth. I asked specific question - "can I avoid confirmation step when using OAth?" I'm indeed capable (and I've done that) to read and use manuals and tutorials, ut beiiii, and being very impressed with resource I'm trying to take a shortcut. If this is not appropriate - I apologize
DroidIn.net
I don't think you can use OAuth without the confirmation step
John Sheehan
Nope, that steps is quite critical to the OAuth process, and the whole OAuth philosophy, really.
Jason Diller
Well... If you make your user save name/pwd then you can input these values for him but that of course defeats the whole purpose of OAuth
DroidIn.net
+3  A: 

If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth.

If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate).

The confirmation step is part of the reason Twitter is using OAuth. There's no getting around it.

There are several libraries out there that implement OAuth for Twitter so you're not reinventing the wheel.

DWRoelands
I don't want to circumvent the step (going to twitter page) if user is not authenticated. My problem that user already has set of credentials and by all likeness these are matching Twitter's so I don't want to reprompt user. But then, again - these may not match.I suppose I can try to do post on the Twitter page with HttpClient but it probably would be hard to crack (if indeed it is a straight POST)
DroidIn.net
A: 

If you want example on how to use OAuth and Twitter I have it in my blog

DroidIn.net
A: 

"If you are writing a desktop Twitter client and you want your application's name to show up instead of "From API", you have to use OAUth. If you want to use OAuth in your desktop Twitter application, you have to go through Twitter's PIN workflow (i.e., sending the user to the Twitter website to authenticate)."

Hold on a moment, how do Twitter clients manage to put their client name in the "via" without you logging in somewhere and copying a PIN back to the application.

I just want a command line client that updates my status and prints "via MyApp". Am I missing something here? (I might be, I've only started trying to figure this out yesterday) In fact if the user isn't authenticated, I don't want to get them to login elsewhere and copy/paste a PIN, I want them to type their user/pass into my application. Like what happens with all the twitter clients I've seen...

Max
Nope. If you want your name to appear with the post you MUST use OAuth. This is a restriction put in place by Twitter. It is quite unfortunate (I, too, am suffering from it) because it is a horrible user experience to popup a browser window from a totally unrelated context. I think the idea of OAuth is great but the implementation could certainly be more seemless.
Josh M.