本帖最后由 dingding5060 于 2011-09-27 15:39:20 编辑

解决方案 »

  1.   

    呵呵,翻墙了的。我现在想做一个效果:在我的站点里面做一个twitter的登录操作,然后登录成功后就显示twitter的好友动态信息。我有账号,也注册应用了。但是不知道请求twitter的登录连接和回调地址怎么拼接。能否帮忙解决下?
      

  2.   

    呵呵 不好意思 没研究过twitter 的API 帮不上你了 帮你UP一下吧 
      

  3.   

    http://www.ibm.com/developerworks/cn/web/wa-oauth2/index.html
      

  4.   

    github 上有个项目 git://github.com/fernandezpablo85/scribe-java.git 方便 OAuth使用。
    package org.scribe.examples;import java.util.Scanner;import org.scribe.builder.*;
    import org.scribe.builder.api.*;
    import org.scribe.model.*;
    import org.scribe.oauth.*;public class TwitterExample
    {
      private static final String PROTECTED_RESOURCE_URL = "http://api.twitter.com/1/account/verify_credentials.xml";
      
      public static void main(String[] args)
      {
        OAuthService service = new ServiceBuilder()
                                    .provider(TwitterApi.class)
                                    .apiKey("6icbcAXyZx67r8uTAUM5Qw")
                                    .apiSecret("SCCAdUUc6LXxiazxH3N0QfpNUvlUy84mZ2XZKiv39s")
                                    .build();
        Scanner in = new Scanner(System.in);    System.out.println("=== Twitter's OAuth Workflow ===");
        System.out.println();    // Obtain the Request Token
        System.out.println("Fetching the Request Token...");
        Token requestToken = service.getRequestToken();
        System.out.println("Got the Request Token!");
        System.out.println();    System.out.println("Now go and authorize Scribe here:");
        System.out.println(service.getAuthorizationUrl(requestToken));
        System.out.println("And paste the verifier here");
        System.out.print(">>");
        Verifier verifier = new Verifier(in.nextLine());
        System.out.println();    // Trade the Request Token and Verfier for the Access Token
        System.out.println("Trading the Request Token for an Access Token...");
        Token accessToken = service.getAccessToken(requestToken, verifier);
        System.out.println("Got the Access Token!");
        System.out.println("(if your curious it looks like this: " + accessToken + " )");
        System.out.println();    // Now let's go and ask for a protected resource!
        System.out.println("Now we're going to access a protected resource...");
        OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
        service.signRequest(accessToken, request);
        Response response = request.send();
        System.out.println("Got it! Lets see what we found...");
        System.out.println();
        System.out.println(response.getBody());    System.out.println();
        System.out.println("Thats it man! Go and build something awesome with Scribe! :)");
      }}
      

  5.   

    http://www.ibm.com/developerworks/cn/web/wa-oauth2/index.html  这上面有个例子
      

  6.   

    这个git://github.com也是要翻墙?
      

  7.   

    实例下载:http://download.csdn.net/detail/dingding5060/3715744