Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
ce296472
Commit
ce296472
authored
Oct 09, 2010
by
Josh Roesslein
Browse files
Allow for secure streams and make sure to properly apply auth for OAuth.
parent
13814fdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
ce296472
...
...
@@ -69,7 +69,8 @@ class Stream(object):
host
=
'stream.twitter.com'
def
__init__
(
self
,
auth
,
listener
,
timeout
=
5.0
,
retry_count
=
None
,
retry_time
=
10.0
,
snooze_time
=
5.0
,
buffer_size
=
1500
,
headers
=
None
):
retry_time
=
10.0
,
snooze_time
=
5.0
,
buffer_size
=
1500
,
headers
=
None
,
secure
=
False
):
self
.
auth
=
auth
self
.
running
=
False
self
.
timeout
=
timeout
...
...
@@ -80,11 +81,16 @@ class Stream(object):
self
.
listener
=
listener
self
.
api
=
API
()
self
.
headers
=
headers
or
{}
if
secure
:
self
.
scheme
=
"https://"
else
:
self
.
scheme
=
"http://"
self
.
body
=
None
def
_run
(
self
):
# setup
self
.
auth
.
apply_auth
(
None
,
None
,
self
.
headers
,
None
)
url
=
"%s%s%s"
%
(
self
.
scheme
,
self
.
host
,
self
.
url
)
self
.
auth
.
apply_auth
(
url
,
'GET'
,
self
.
headers
,
None
)
# enter loop
error_counter
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment