Guest skinie18 Posted July 15, 2012 at 02:09 AM Report Share #468684 Posted July 15, 2012 at 02:09 AM (edited) Ola eu encontrei o twitter4j.org v2.2.6, e estava a tentar fazer o metodo que faz o login da cessao de twitter mas nao estou a conseguir. A quem ja trabalhou com isto agradecia a ajuda. O meu codigo simplificado: import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; import twitter4j.User; import twitter4j.auth.*; public class TwitterLab { private static Twitter twitter; public static void main(String[] args) { String usr = "teste"; String pass = "test"; try { twitter = new TwitterFactory().getInstance(); AccessToken at = twitter.getOAuthAccessToken(usr, pass); twitter = new TwitterFactory().getInstance(at); User user = twitter.verifyCredentials(); System.out.println("Successfully verified credentials of " + user.getScreenName()); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to verify credentials: " + te.getMessage()); System.exit(-1); } } } Alguem me pode ajudar com o algum codigo, ou explicando porque que me da o erro: java.lang.IllegalStateException: OAuth consumer key/secret combination not supplied ??? Edited July 15, 2012 at 02:23 AM by Guest Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now