We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone, I'm working on a sketch in which I need to find a random user from a specific location and @mention them in a tweet.
-So far I have not been able to do it, mostly because I'm just not an experienced coder and have never dealt with the twitter API before. -But this is the frankestein's monster code what I'm trying:-
I've made some progress, please look at comment below.
I appreciate any help! Thanks in advance!
Answers
Here is my new version: import twitter4j.conf.*; import twitter4j.*; import twitter4j.auth.*; import twitter4j.api.*; import java.util.*;
I've managed to get 15 tweets with all their info from the required location. Now all that I'm missing is a way to isolate and select a screenName from the List. Suggestions?
I now have working code that does the first part of what I want. Query twitter and return a single random user name based on geoLocation.
Here's my code for future reference:
So after looking into this, it turns out this code will only return the latest tweets from the location and print the usernames, so if a user tweeted more than once that user will be duplicated in the results. I really need help with this, it's been a lot of work and I just can't figure this out.
I found the .searchUsers() function, not sure how to create a query for it properly.
Any help is greatly appreciated