JTwitter OAuth 路标示例
我相信 JTwitter 支持 OAuth 对开发人员帐户进行身份验证,但是我无法让它们中的任何一个工作。
JTwitter 文档说路标是受支持的方法 - 但即使在添加路标库之后,我似乎也找不到他们使用的 OAuthSignpostClient 类:
OAuthSignpostClient client = new OAuthSignpostClient(JTWITTER_OAUTH_KEY, JTWITTER_OAUTH_SECRET, "oob");
Twitter jtwit = new Twitter("yourtwittername", client);
// open the authorisation page in the user's browser
client.authorizeDesktop();
// get the pin
String v = client.askUser("Please enter the verification PIN from Twitter");
client.setAuthorizationCode(v);
// Optional: store the authorisation token details
Object accessToken = client.getAccessToken();
// use the API!
jtwit.setStatus("Messing about in Java");
有人编写了该代码段工作的代码吗?
请帮助
安迪
I believe JTwitter supports OAuth to authenticate against a developer account , however i cannot get any of them working.
The JTwitter docs say signpost is the supported method - yet I cannot seem to find the OAuthSignpostClient class they use even after adding the signpost libs:
OAuthSignpostClient client = new OAuthSignpostClient(JTWITTER_OAUTH_KEY, JTWITTER_OAUTH_SECRET, "oob");
Twitter jtwit = new Twitter("yourtwittername", client);
// open the authorisation page in the user's browser
client.authorizeDesktop();
// get the pin
String v = client.askUser("Please enter the verification PIN from Twitter");
client.setAuthorizationCode(v);
// Optional: store the authorisation token details
Object accessToken = client.getAccessToken();
// use the API!
jtwit.setStatus("Messing about in Java");
Has anybody code that code segment working?
Please help
Andy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OAuthSignpostClient 类是 JTwitter 的一部分,与 Twitter 类位于相同的 jar 和包中。使用 import Winterwell.jtwitter.OAuthSignpostClient 来查找它。
如果找不到,请检查您拥有的 JTwitter 版本(请参阅 Winterwell.jtwitter.Twitter 中的版本字段)。当前版本是1.6.3。早期版本可能没有路标类。
我希望这有帮助。
The OAuthSignpostClient class is part of JTwitter and is in the same jar and package as the Twitter class. Use import winterwell.jtwitter.OAuthSignpostClient to find it.
If you can't find it, Check what version of JTwitter you have (see the version field in winterwell.jtwitter.Twitter). The current version is 1.6.3. Earlier versions might not have the signpost class.
I hope that helps.
使用 SHA1 校验和来验证文件完整性。
http://code。 google.com/p/oauth-signpost/downloads/detail?name=signpost-core-1.2.1.1.jar
也许这个解决方案对您有帮助
Use the SHA1 checksum to verify file integrity.
http://code.google.com/p/oauth-signpost/downloads/detail?name=signpost-core-1.2.1.1.jar
May be this solution is helpful for you