I'm working on a little program that integrates with twitter (using twitter4j) to get various pieces of information that will eventually output an image. I've got most things running smoothly, including keyword queries and user timelines, but I'm having some trouble with getting user images. I found some
code that pulls images based on keywords tweeted, but I'd like to pull the image of a specific user instead. I'm having trouble adapting the code.
Here is the code as it currently is:
String imgTemp = null;
try{
Query query = new Query("keyword");
QueryResult result = (QueryResult) twitter.search(query);
java.util.List tweets = result.getTweets();
Tweet t = (Tweet) tweets.get(0);
imgTemp = t.getProfileImageUrl();
}
catch (Exception e){
System.out.println(e);
}
//loads image and resizes to fill window
img = loadImage(imgTemp, "png");
img.resize(600,0);
image(img,0,0);
Every attempt I make at editing the variables throws back to me the error "The function getProfileImageUrl does not exist." But if I change it back to the code above it runs fine (just doesn't do what I'd like it to.) I'm slowly going crazy.