Using tweepy, we can search for tweets by location and for multiple locations, for example:
stream.filter(locations=[-122.75,36.8,-121.75,37.8,-74,40,-73,41], track=terms)
However, when I try to put all tweets from NY on one list and tweets from SF on another list, I cannot assign them to any of the lists. This is my piece of code:
NY = 74,40,-73,41 NewYorkCNN = [] if status.coordinates == NY or status.place == 'New York': for term in terms: if term in status.text: NewYorkCNN.append(term)
How can they be correctly placed on the correct list?
source share