0

I want to get the coordinates of tweets longitude and latitude, but I don't know how to do it. How to get coordination of data from Twitter API?

HOw do we get the geolocation using Spring social twitter ?

The Tweet class doesn't define a getLocation method.

Mirou NN
  • 21
  • 1

2 Answers2

0

The geo information of a Tweet will be included when you request that specific tweet via the API, as documented here: https://dev.twitter.com/rest/reference/get/statuses/show/%3Aid

Martyn Davies
  • 1,493
  • 9
  • 12
  • 1
    I want to know how to get geolocation with Spring social twitter, – Mirou NN Jan 27 '15 at 19:02
  • 1
    In Spring you're looking for org.springframework.social.twitter.api.TweetData - which should give you more data, and a displayCoordinates method – Martyn Davies Jan 27 '15 at 21:29
  • 1
    Sorry but the getLocation returns string location , I want to know how do we get the geo coordinates of the tweet – Mirou NN Jan 29 '15 at 13:06
0

When you do searches for twitter with the searchOperation, it returns a org.springframework.social.twitter.api.Tweet Object which doesn't seem to have the location of the tweets.

However, the org.springframework.social.twitter.api.Tweet object has a org.springframework.social.twitter.api.TwitterProfile object. The TwitterProfile Object has a location field, which is the users location.

Paul John
  • 1,626
  • 1
  • 13
  • 15