List of usage examples for twitter4j TwitterStreamFactory getInstance
public TwitterStream getInstance(Authorization auth)
From source file:br.shura.team.mpsbot.runtime.ConnectedBot.java
License:Open Source License
public void connect() { ApiKeys keys = getBot().getApiKeys(); if (!isConnected()) { Configuration configuration = new ConfigurationBuilder().setOAuthAccessToken(keys.getAccessToken()) .setOAuthAccessTokenSecret(keys.getAccessTokenSecret()) .setOAuthConsumerKey(keys.getConsumerKey()).setOAuthConsumerSecret(keys.getConsumerSecret()) .build();// w ww . j a v a 2s .com OAuthAuthorization auth = new OAuthAuthorization(configuration); TwitterStreamFactory streamFactory = new TwitterStreamFactory(configuration); ImageUploadFactory uploadFactory = new ImageUploadFactory(configuration); this.streamer = streamFactory.getInstance(auth); this.uploader = uploadFactory.getInstance(auth); } }