Twitter机器人:获取另一个帐户的访问令牌,而没有3腿OAuth流?
我控制了三个Twitter帐户:一个是我的主要帐户,另外两个应该自动通过机器人发布内容。我创建了机器人逻辑并将其添加到Twitter的开发工具中,并且可以轻松地将其发布到我的主帐户中。
现在,我需要为我的两个二级帐户添加访问令牌。我的问题是 - 最简单的方法是什么。
据我所知,Twitter只能启用一种方法: 3腿的Oauth流。这并不是太复杂了,但是在我看来,需要使用回调URL设置模拟网站,考虑到我只需要生成两个API令牌,这似乎太多了。我想念什么吗?
I am in control of three twitter accounts: One is my main account, the other two are supposed to automatically post content via a bot. I created the bot logic and added it to Twitter's development tools and I can easily use it to post to my main account.
Now I need to add the access tokens for my two secondary accounts. My question is - what's the easiest way to do this.
As far as I can see, Twitter only enables one way to do this: 3-legged OAuth flow. It is not too complex, but it seems to me to require setting up a mock website with callback url, which seems like too much considering I only need to generate two api tokens. Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一些替代方法可以通过命令行工具为OAuth 1.0A生成访问令牌和访问令牌秘密,使您可以使用“基于PIN的” OAUTH FLOW。
一个示例是Twitter自己的
twurl
api测试工具,这需要您还安装了红宝石。这将使您可以验证一个用户帐户(它仍然在Twitter.com上打开一个窗口以使您进行身份验证),并将它们存储到
< /a>是一个独立的应用程序,可以做同样的事情。〜/.twurlrc
文件中。还有tw-oob-oauth-cli
There are some alternative ways to generate access token and access token secret for OAuth 1.0A via command line tools which allow you to use the “PIN-based” OAuth flow.
One example would be Twitter’s own
twurl
tool for API testing, which requires you to also have Ruby installed. This will let you authenticate a user account (it still pops open a window onto twitter.com to have you do the authentication) and stores them into the~/.twurlrc
file in your home directory. There is alsotw-oob-oauth-cli
which is a standalone app for doing the same thing.您不会错过任何东西。之所以需要强迫用户拥有一个他们信任的浏览器,并看到他们在
https://twitter.com/
上,这样他们就可以相信这是一个安全的地方密码。You're not missing something. The reason this is required is to force users have a browser they trust open and see that they are on
https://twitter.com/
, so they can trust that it's a safe place to put in their password.