Twitter API: post on behalf of whom?

送分小仙女□ 提交于 2019-12-10 17:19:06

问题


I want to use Twitter API so my program can post some tweets. To use it I have to register application in dev-center and get some parameters like "Consumer key", "Consumer secret" etc. Then I can use either REST API, or some libraries like twitter4j - OK, that's simple.

But the question is: who will be the "author" of such tweets? Or, in other words, where can I find them after posting? Will they be posted by application or by some user? I can't really figure out how particular user binds to registered API-application... Or how can I specify ("log-in") user to post tweet on behalf of?


回答1:


The "author" is always going to be the authenticating user. From the Twitter API documentation for statuses/update:

Updates the authenticating user's current status, also known as tweeting.

To answer your other question about authenticating with another user's username/password, it is possible but you need to get permission from Twitter. You also still need to use OAuth. Check out the Twitter API xAuth documentation.




回答2:


You need to have a twitter account to register your application. So your account will be the author of your posts.



来源:https://stackoverflow.com/questions/20306909/twitter-api-post-on-behalf-of-whom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!