Get status of users with streaming api


#1

I have created a class which will get the status of the user using StatusListener. I want to configure for multiple users.

    ConfigurationBuilder cb = new ConfigurationBuilder();
    cb.setDebugEnabled(true);
    cb.setOAuthConsumerKey("apikey");
    cb.setOAuthConsumerSecret("apiSecretKey");
    
    cb.setOAuthAccessToken("bbb"); // user access token
    cb.setOAuthAccessTokenSecret("bbb"); // user access token secret
	
	StatusListener listener = new StatusListener() {

		public void onException(Exception arg0) {
			// TODO Auto-generated method stub
			
		}

		public void onStatus(Status status) {
			// TODO
		}

		public void onDeletionNotice(StatusDeletionNotice arg0) {
			// TODO Auto-generated method stub
			
		}

		public void onScrubGeo(long arg0, long arg1) {
			// TODO Auto-generated method stub
			
		}

		public void onTrackLimitationNotice(int arg0) {
			// TODO Auto-generated method stub
			
		}
		
	};

	TwitterStreamFactory factory = new TwitterStreamFactory(cb.build());
	twitterStream = factory.getInstance();
	twitterStream.addListener(listener);
	twitterStream.sample();

How can i configure multiple users i.e give access tokens in configuration so that i get there status updates ?


#2

Are you trying to use User Streams? Site Streams is the multi-user version of User Streams. You can read about it here: [node:6346]