For the time being, I don't know how to narrow down the locale from the STREAMING API due to lack of knowledge. So I usually use Search to pick up "Nau" and "i'm at" and plot them.
I did it like that.
for tweet in tweets["statuses"]:
User = (tweet["user"]["screen_name"].encode("utf-8"))
try:
Place = (tweet["place"]["bounding_box"]["coordinates"])
flat_list = []
for e in Place:
flat_list.extend(e)
flat_list2 = []
for b in flat_list:
flat_list2.extend(b)
flat_list3 = []
for c in flat_list:
flat_list3.extend(c)
geolng = flat_list3[0]
geolat = flat_list3[1]
except:
pass
Well, like this, let's open only Place with try.
Place = (tweet["place"]["bounding_box"]["coordinates"])
If you fetch it with, the list will be nested, so use flat_list to cancel the nesting. No, it's not really beautiful ...
Export the acquired data as CSV and plot it on a map.
As expected, there are many metropolitan areas. Do local people not tweet with a lot of positions, or is the Twitter population itself small?
Oh, is the keyword to narrow down useless?