public TwitterLogin() { twitter = TwitterFactory.getSingleton(); twitter.setOAuthConsumer(consumerKey, consumerSecret); }
private void postOnTwiter(StringBuffer tweet) { try { Twitter twitter = TwitterFactory.getSingleton(); Status status = twitter.updateStatus(tweet.toString()); LOG.debug("Successfully updated status to " + status.getText()); } catch (TwitterException e) { LOG.error("ERROR when trying to post on Twitter ", e); } }