I have twitter user id I want get home time line of user

java

#1

this code give me one tweet of user and id of specific area .

 ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setDebugEnabled(true);
        cb.setOAuthConsumerKey("********************");
        cb.setOAuthConsumerSecret("*****************************");
        cb.setOAuthAccessToken("**********************");
        cb.setOAuthAccessTokenSecret("*********************************");
        TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();

        
        StatusListener listener;
        listener = new StatusListener() {
            
            @Override
            public void onException(Exception arg0) {
                // TODO Auto-generated method stub

            }

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

            }

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

            }

            @Override
            public void onStatus(Status status) {
                



              User user = status.getUser();
                
           //end wala code ko uder  "String content = status.getText();" us sa match karna chata hon wo kasa kro ?
                   
                
                 //gets Username
                String username = status.getUser().getScreenName();
               
                
                 System.out.println(username);
                String profileLocation = user.getLocation();
               System.out.println(profileLocation);
               
                long tweetId = status.getId(); 
               System.out.println(tweetId);
               
                String content = status.getText();
                System.out.println(content +"\n");

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

            }

            @Override
            public void onStallWarning(StallWarning sw) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

        };
        
        
       
FilterQuery fq = new FilterQuery();
  fq.locations(
          
        
          
          new double[][]{
           new double[]{62.9d, 25.21d},
                new double[]{73.3d, 35.2d}

          
       
          } );
 twitterStream.addListener(listener);
        twitterStream.filter(fq);
}};

This code give me user id , user tweet and location .now i want to get
user time line when i add user id .those user id get from code


#2

You probably don’t want to use the Streaming API for this. You should check the GET statuses/user_timeline documentation.


#3

how code use in java ?


#4

I’d probably take a look at Twitter4J and some of the example code they share.