Commit 3d51a653 authored by Sam Kaufman's avatar Sam Kaufman Committed by Joshua Roesslein
Browse files

Added filtering by locations to the streaming API.

parent eaa91f6b
......@@ -180,7 +180,7 @@ class Stream(object):
self.url += '&count=%s' % count
self._start(async)
def filter(self, follow=None, track=None, async=False):
def filter(self, follow=None, track=None, async=False, locations=None):
params = {}
self.headers['Content-type'] = "application/x-www-form-urlencoded"
if self.running:
......@@ -190,6 +190,9 @@ class Stream(object):
params['follow'] = ','.join(map(str, follow))
if track:
params['track'] = ','.join(map(str, track))
if locations and len(locations) > 0:
assert len(locations) % 4 == 0
params['locations'] = ','.join(map(str, locations))
self.body = urllib.urlencode(params)
self._start(async)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment