stream.filter(locations=[-122.75,36.8,-121.75,37.8,-74,40,-73,41],track=["twitpic"])
Это работает. Однако это не «И». Это «ИЛИ». Эта строка получает ключевое слово ИЛИ местоположения.
Как мне сделать это "И"?
Вот код библиотеки, которую я использую:
def filter(self, follow=None, track=None, async=False, locations=None):
self.parameters = {}
self.headers['Content-type'] = "application/x-www-form-urlencoded"
if self.running:
raise TweepError('Stream object already connected!')
self.url = '/%i/statuses/filter.json?delimited=length' % STREAM_VERSION
if follow:
self.parameters['follow'] = ','.join(map(str, follow))
if track:
self.parameters['track'] = ','.join(map(str, track))
if locations and len(locations) > 0:
assert len(locations) % 4 == 0
self.parameters['locations'] = ','.join(['%.2f' % l for l in locations])
self.body = urllib.urlencode(self.parameters)
self.parameters['delimited'] = 'length'
self._start(async)
https://github.com/joshthecoder/tweepy/blob/master/tweepy/streaming.py