twitter 4j
in
Contributed Library Questions
•
2 years ago
Hello all
i am working on this script using twitter 4j library to get data from twitter about a search word...but i want to add the geolocation i.e, the lattitude and longitude information of users also in the println. Can i write a new string for it. Please help me regarding this as it is not working for the geolocation and if i add here it gives error as class or function doesn't exist.
The original script is
Twitter myTwitter;
void setup() {
myTwitter = new Twitter("username", "password");
try {
Query query = new Query("search word");
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);
};
};
void draw() {
};
1