File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
import oauth2 as oauth
3
3
import urlparse , time , webbrowser
4
- from twisted .internet import reactor , protocol
4
+ from twisted .internet import reactor , protocol , ssl
5
5
from twisted .web import http
6
6
7
7
CONSUMER_KEY = 'CHANGEME'
@@ -98,7 +98,7 @@ def fetch_access_token():
98
98
return (access_token ['oauth_token' ], access_token ['oauth_token_secret' ])
99
99
100
100
def build_authorization_header (access_token ):
101
- url = "http ://%s%s" % (TWITTER_STREAM_API_HOST , TWITTER_STREAM_API_PATH )
101
+ url = "https ://%s%s" % (TWITTER_STREAM_API_HOST , TWITTER_STREAM_API_PATH )
102
102
params = {
103
103
'oauth_version' : "1.0" ,
104
104
'oauth_nonce' : oauth .generate_nonce (),
@@ -135,5 +135,5 @@ def build_authorization_header(access_token):
135
135
136
136
# Twitter stream using the Authorization header.
137
137
twsf = TwitterStreamerFactory (auth_header )
138
- reactor .connectTCP (TWITTER_STREAM_API_HOST , 80 , twsf )
138
+ reactor .connectSSL (TWITTER_STREAM_API_HOST , 443 , twsf , ssl . ClientContextFactory () )
139
139
reactor .run ()
You can’t perform that action at this time.
0 commit comments