[英]Send multiple tweets(mentions) with multiple accounts Twitter4j
I am designing an application using which the users would be able to send multiple tweets(mentions) from multiple accounts and am using Twitter4j for the same. 我正在设计一个应用程序,用户可以使用该应用程序从多个帐户发送多个推文(提及),并且将Twitter4j用于同一应用程序。 Regarding this, I have a few questions: 对此,我有几个问题:
EDIT Kindly note that I am making a desktop app, not a web app.So a PIN based authentication is necessary. 编辑请注意,我正在制作桌面应用程序,而不是Web应用程序。因此,需要基于PIN的身份验证。 Also I am not sure about the validity lifetime of an access token.Will the access token once generated by using OOB authentication be valid forever so that I can save it in a database and hence enable user to authenticate only once? 我也不确定访问令牌的有效期,使用OOB身份验证生成的访问令牌是否将永远有效,以便我可以将其保存在数据库中并因此仅允许用户进行一次身份验证?
Some points to note: 需要注意的几点:
oauth_verifier
is appended with the callback url which you can fetch from the url itself. 身份验证 :无需使用基于引脚的身份验证就可以获取访问令牌,因为在创建应用程序时,您必须指定一个回调URL,这样就不必复制和粘贴该引脚,而是在参数oauth_verifier
添加了oauth_verifier
您可以从网址本身获取的回调网址。 With this oauth_verifier
, you can get a ccess_token
and token_secret
as mentioned here 有了这个oauth_verifier
,你可以得到一个ccess_token
和token_secret
提到这里 try catch
can be more helpful here. 异常处理 :除了简单的try catch
以外,这里别无其他方法。 Edit: For desktop app there is no other alternative, so you have to do a pin based authentication and since twitter works on Oauth1, so as of now, the validity of the access_token
and token_secret
is lifetime. 编辑:对于桌面应用程序,没有其他选择,因此您必须进行基于引脚的身份验证,并且由于twitter在Oauth1上有效,因此,到目前为止, access_token
和token_secret
的有效性是有效期。 So authentication is required only once and the api calls can be made using same tokens. 因此,仅需要一次身份验证,并且可以使用相同的令牌进行api调用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.