I'm developing a piece of code whereby I want to track a key word using the Twitter streaming API.
Obviously, when I track the key word I get global results. I'm aware you cant stream both key words and locations simulatiously due to the API parameter requirements.
Instead I plan on only saving the streamed tweets which list their profile location as being in a certain city (London in this case).
Currently I'm trying the following
def on_status(self,status):
try:
locations=status.user.location
if locations == ['London']:
#Save to database
else:
pass
However, this isn't saving any tweets which contain the profile location as London