Home>

I am trying to get a tweet with location information using python.
Although it moved, I was able to get tweets including queries, but I could not get tweets containing location information.

Error message

source code: !/usr/bin/env python3 -*-coding: utf-8-*-

import tweepy
import csv

consumer_key =""
consumer_secret =""
access_key =""
access_secret =""

Get Tweets

tweet_data = []

csv output

with open ('tweets_20171225.csv','a', newline ='', encoding ='utf-8') as f:
writer = csv.writer (f, lineterminator ='\ n')
writer.writerow (["id","created_at","geo","text"])
writer.writerows (tweet_data)

pass

Try it

I deleted count = 100, items (100), or (api.search, geocode ="").
I hope you can tell me what is wrong.
I would like to get only tweets with location information.

information:(language/FW/tool version etc.)

More information