Tweepy Streaming API returning “None” for coordinates on geo-enabled tweets

后端 未结 1 1427
温柔的废话
温柔的废话 2020-12-30 18:37

I am using Tweepy to access the streaming API. I am able to get results with the code below but for tweets where the Geo Enabled value is \"True\" I am getting a Coordinates

1条回答
  •  心在旅途
    2020-12-30 19:38

    The problem is not related to tweepy itself.

    For example, see this tweet (https://api.twitter.com/1/statuses/show.json?id=341458303064354817&include_entities=true) - it has geo_enabled set to true while geo, coordinates and place equal to null.

    According to twitter docs:

    geo_enabled: When true, indicates that the user has enabled the possibility of geotagging their Tweets.

    So, it's not a strict rule that there will be location info in the tweet data if geo_enabled is true. Just check if status.geo or status.coordinates are not None in your listener.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题