Skip to content
Myr

add prefetch=False to streaming example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Gareth Lloyd · committed by Gareth Lloyd · parent c8f166f · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/user/advanced.rst+1 added-1 removed
281 unmodified lines
282 import requests283 import json284285 r = requests.post('https://stream.twitter.com/1/statuses/filter.json',286 data={'track': 'requests'}, auth=('username', 'password'))286 data={'track': 'requests'}, auth=('username', 'password'), prefetch=False)287288 for line in r.iter_lines():289 if line: # filter out keep-alive new lines290 print json.loads(line)
271 unmodified lines