Loading...
Logo
Processing Forum
Hey guys,

So this is my code so far...

String consumerKey = "*************************";
String consumerSecret = "*****************************";
String accessToken = "***********************************";
String accessSecret = "*******************************";
AccessToken token;


Twitter myTwitter;

void setup(){
   myTwitter = new TwitterFactory().getInstance();
   myTwitter.setOAuthConsumer(consumerKey, consumerSecret);
   token = new AccessToken(accessToken, accessSecret);
   myTwitter.setOAuthAccessToken(token);
 
  try{
    Query query = new Query("@amwood91");
    query.setRpp(100);
    QueryResult result = myTwitter.search(query);
  
    ArrayList tweets = (ArrayList) result.getTweets();
  
    for(int i = 0;i<tweets.size();i++){
      Tweet t = (Tweet) tweets.get(i);
      String user = t.getFromUser();
      String msg = t.getText();
      Date d = t.getCreatedAt();
      println("Tweet by" + user + "at" + d + ": " + msg);
    }
  }
  catch(TwitterException te){
    println("couldn't connect: " +te);
  }
 
}

What I want to do is search for keywords BUT only from a specific users timeline.

Any ideas???