简体   繁体   English

Google Apps脚本代表用户的推文

[英]Google Apps Script to Get Users' Tweets on Their Behalves

I was trying out Google Apps Script and Twitter API. 我正在尝试Google Apps脚本和Twitter API。 It works perfectly for my Twitter account but what I want is users to make my script work on their behalves logging in with their Twitter account. 它非常适合我的Twitter帐户,但是我想要的是用户使我的脚本能够以他们的Twitter帐户登录的名义工作。

I was hoping this process is automated by turning on "Allow this application to be used to Sign in with Twitter" in Settings page of my Twitter application (asking twitter user authorization to execute app each time). 我希望通过在我的Twitter应用程序的“设置”页面中打开“允许此应用程序用于通过Twitter登录”来自动执行此过程(向Twitter用户授权以每次执行该应用程序)。 It is not. 它不是。 GAS script executes as if my user is already authanticated by twitter. GAS脚本的执行就像我的用户已经被twitter认证一样。

I understand how it is done in general from Twitter developer documentations (3-legged authorization), but I can't figure out how it is done with given GAS OAuthConfig class and URL Fetch Service. 我从Twitter开发人员文档(三足授权)中大致了解了它是如何完成的,但是我无法弄清楚给定的GAS OAuthConfig类和URL Fetch Service是如何完成的。 I've played with oAuthUseToken , assigning different values such never or if_available , it didn't work either. 我玩过oAuthUseToken ,分配了不同的值,例如neverif_available ,它也不起作用。

Any help would be appreciated. 任何帮助,将不胜感激。

So far what I have found, but didn't try out yet (I was searching for completely different subject, yet somehow related to this): 到目前为止,我已经找到了,但是还没有尝试(我正在寻找完全不同的主题,但是与此相关的东西):

Eric Coleda wrote in this Google Apps Script Issues post that we can now make our own OAuth2 flow by using state tokens and the usercallback endpoint which were added to ScriptApp Class . Eric Coleda在此Google Apps脚本问题帖子中写道,我们现在可以使用状态令牌和添加到ScriptApp类的usercallback端点来创建自己的OAuth2流。

They don't have a finished example at the time of this post, neither do I. 在撰写本文时,他们还没有完成的示例,我也没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM