I can now post a tweet on user’s behalf - however the problem is, Tweeter website is offering PIN to user and enter in the consumer site - NOW THIS PIN IS UNACCEPTABLE…HOW CAN I PROGRAM SO THAT THE PIN CAN BE AVOIDED ALLTOGETHER. Not only that, the Tweeter website is offering to enter PIN for all posts regardless of whether the user is logged in or not - this too is unacceptable
Please HELP! See the code below - I am using Mule Twitter connector…
public void authorize() throws Exception{
MuleContext muleContext = null;
MuleContextFactory contextFactory = new DefaultMuleContextFactory();
MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
muleContext = contextFactory.createMuleContext(contextBuilder);
muleContext.start();
setMuleContext(muleContext);
TwitterConnector tConnect = new TwitterConnector();
tConnect.setMuleContext(muleContext);
tConnect.setConsumerKey("some key");
tConnect.setConsumerSecret("some secret");
tConnect.connect(null,null);
RequestToken _requestToken = tConnect.requestAuthorization(null);
setRequestToken(_requestToken);
}
public void tweet(String pin) throws Exception{
TwitterConnector tConnect = new TwitterConnector();
tConnect.setMuleContext(muleContext);
tConnect.setConsumerKey("some key");
tConnect.setConsumerSecret("some secret");
tConnect.connect(null,null);
AccessToken accessToken =
tConnect.setOauthVerifier(getRequestToken(), pin);
String accesskey = accessToken.getToken();
String accessSecret = accessToken.getTokenSecret();
tConnect.connect(accesskey,accessSecret);
User user = tConnect.showUser();
String username = user.getName();
tConnect.updateStatus("some tweet", 111, null, null);
}