Twitter REST change “from API” to something meanin

2020-02-14 03:25发布

问题:

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?

回答1:

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.



回答2:

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.



回答3:

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



回答4:

"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...



标签: rest twitter