1

I am trying to get processing to show me the location of the twitter user by using getLocation() but all I get is null.

I suspect that I need to add something but do not know what.

I am using processing, a java platform and the Twitter4J library.

frictionlesspulley
  • 11,070
  • 14
  • 66
  • 115
user47
  • 53
  • 7
  • 1
    Can you post some code and show us what you've tried? – Mike Nov 16 '11 at 13:42
  • im using this tutorial: http://blog.blprnt.com/blog/blprnt/updated-quick-tutorial-processing-twitter So im just getting the username and it's tweet. My code currently looks like this: http://codepad.org/2rZqqrAc – user47 Nov 16 '11 at 15:36
  • I've been looking at the source code for the Twitter4j API, and I can't find which class implements the `Tweet` interface. Therefore, I can't be sure, but it seems to me that not all Tweets will have a Location associated with there, and therefore it's entirely possible that your call to `tweet.getLocation()` will return a null. Are you sure that's not a perfectly valid response? – Mike Nov 16 '11 at 16:58
  • Got it fixed! The code looks like this: http://codepad.org/d6aL7zWW Needed to change the class I was using to "user" not "tweet". Thanks for the help! – user47 Nov 17 '11 at 12:21
  • But that is the user's location in his profile. The GeoLocation of a tweet object contains where the User tweeted from. So, that is inaccurate. – vipulnj Dec 02 '17 at 19:37

0 Answers0