Twitter4j error: Cannot find a class or type named "Configuration Builder"
in
Contributed Library Questions
•
9 months ago
Hi
I'm having difficulty getting Twitter4j (v3.0.3) working under Processing 2.0b7. I've downloaded, unzipped, copied and renamed the files correctly (I think) into the sketchbook's libraries folder. Using the code below from the tutorial at
http://blog.blprnt.com/blog/blprnt/updated-quick-tutorial-processing-twitter
I get a 'Cannot find a class or type named "Configuration Builder"' error. I'm pretty sure I've imported the library correctly because if I rename the import line to import twitter5j.* or some other non-existent library it throws an error.
Any ideas what could be going wrong?
Thanks
Matt
I'm having difficulty getting Twitter4j (v3.0.3) working under Processing 2.0b7. I've downloaded, unzipped, copied and renamed the files correctly (I think) into the sketchbook's libraries folder. Using the code below from the tutorial at
http://blog.blprnt.com/blog/blprnt/updated-quick-tutorial-processing-twitter
I get a 'Cannot find a class or type named "Configuration Builder"' error. I'm pretty sure I've imported the library correctly because if I rename the import line to import twitter5j.* or some other non-existent library it throws an error.
Any ideas what could be going wrong?
Thanks
Matt
- import twitter4j.*;
ConfigurationBuilder cb;
Twitter twitter;
void setup() {
cb = new ConfigurationBuilder();
cb.setOAuthConsumerKey("MpmV1xOOFociwNjp3FNfA");
cb.setOAuthConsumerSecret("fjlsBtF98cq0VuCHXLQ78uyOz7fr8lm9WLhFbb4aU");
cb.setOAuthAccessToken("6038892-lHWqBpkKhfAsJkCtyEeB3XORn9sGZP3PEy5L7eRKtk");
cb.setOAuthAccessTokenSecret("REyXt8jvTdGUH3UkvGRJcXzB0nAGCjWvc39IlpM2NY");
twitter = new TwitterFactory(cb.build()).getInstance();
Query query = new Query("#processing");
query.setRpp(100);
try {
QueryResult result = twitter.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);
};
}
void draw() {
}
1