twitter4j how to get only statuses with location data from a twitter stream

后端 未结 2 771
-上瘾入骨i
-上瘾入骨i 2021-01-07 13:27

I\'m getting high numbers of \"onTrackLimitationNotice\". I\'d like to narrow my predicate by only searching for statuses with geo location, but all geo locations? Can this

2条回答
  •  梦谈多话
    2021-01-07 13:55

    Not an answer but a Simple workaround:

    I know most of people don't have GPS enabled when they tweet and others would not like to share their location!

    But they are still sharing their location!! Guess how? On their profiles! Their hometown, their country is mostly visible, which can give you an approximate location of where the tweet came from! You can query for the user's profile and thus his/her location using the Rest API

    twitter.showUser(userScreenName).getLocation();

提交回复
热议问题