Как извлечь лат / лон из запроса твиттера? - PullRequest
0 голосов
/ 07 апреля 2020

Я просто пытаюсь получить данные широты / долготы из последних твитов (аналогично структуре кода ниже). Нет радиуса, нет карт, только необработанные данные широты и долготы. Я просмотрел твипную документацию и не могу найти то, что мне нужно. Это, вероятно, простое исправление, но я довольно новичок в этом. Любая помощь будет отличной! TIA.

from tweepy import *
from tweepy.streaming import StreamListener
import json

consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""

#Creating authentication object
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)

#Setting your access token and secret
auth.set_access_token(access_token, access_token_secret)

#Creating the API object while passing in auth information
api = tweepy.API(auth)

#The search term you want to find
query = ["COVID-19", "deaths"]

#Language code (Follows ISO 639-1 standards)
language = "en"

#Calling the user_timeline function with our parameters
results = api.search(q=query, lang=language)

#foreach through all tweets pulled
for tweet in results:
    print (tweet.user.screen_name,"Tweeted:",tweet.text)
    print ("Location:", tweet.user.location, tweet.text)
    #print (api.update_status(tweet.text))
    print ("Date:", tweet.created_at, tweet.text)
...