Twitter OAuth in console application

佐手、 提交于 2019-12-20 01:38:21

问题


Is it possible to authorize twitter console application without visiting authentication web page?

I need it because I'm developing app that grab direct messages from our corporate twitter. This console application is scheduled on web server and is not driven by human.

Regards, Alexey Zakharov


回答1:


You can ask Twitter for an access token by supplying a username and password using XAuth. This circumvents the need to redirect to OAuth webpages to get valid access without asking the user for username and password. Applications do need to ask permission from Twitter by email to be able to use this web service method. You should only use it to get a valid access token and then save that, and not persist the username/password in any way. It might be a suitable scenario for your console application?




回答2:


Check out TWURL. It's command-line CURL with Twitter OAuth built in: http://github.com/marcel/twurl




回答3:


Its possible to authorize any oAuth based API via Console.

if you have some sample code that your working with please share.

Also: http://p2p.wrox.com/content/articles/twitter-development-using-oauth-authenticate-against-twitter-api-walkthroughs



来源:https://stackoverflow.com/questions/3652894/twitter-oauth-in-console-application

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