Skip to content

Instantly share code, notes, and snippets.

@superalsrk
Created July 18, 2013 14:24
Show Gist options
  • Save superalsrk/6029760 to your computer and use it in GitHub Desktop.
Save superalsrk/6029760 to your computer and use it in GitHub Desktop.
twitter4j test appliaton
package OauthTest;
import java.util.Properties;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.RequestToken;
public class TwitterTest {
public static void main(String[] args) throws TwitterException {
Properties systemProperties = System.getProperties();
systemProperties.setProperty("http.proxyHost","127.0.0.1");
systemProperties.setProperty("http.proxyPort","8087");
Twitter twitter = TwitterFactory.getSingleton();
twitter.setOAuthConsumer("xPV8uwJ6JlxznoNGISbkTg", "vJBd9Jq75u51WttiMON6V405v4iyCrYUSw4OZMVhHDM");
RequestToken requestToken = twitter.getOAuthRequestToken();
System.out.println(requestToken.getAuthorizationURL());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment