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
f334323e
Commit
f334323e
authored
Apr 29, 2014
by
Aaron Hill
Browse files
Add proxy support
parent
f24342c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
tweepy/api.py
View file @
f334323e
...
...
@@ -19,7 +19,7 @@ class API(object):
cache
=
None
,
api_root
=
'/1.1'
,
search_root
=
''
,
retry_count
=
0
,
retry_delay
=
0
,
retry_errors
=
None
,
timeout
=
60
,
parser
=
None
,
compression
=
False
,
wait_on_rate_limit
=
False
,
wait_on_rate_limit_notify
=
False
):
wait_on_rate_limit_notify
=
False
,
proxy
=
None
):
self
.
auth
=
auth_handler
self
.
host
=
host
self
.
search_host
=
search_host
...
...
@@ -34,6 +34,9 @@ class API(object):
self
.
wait_on_rate_limit
=
wait_on_rate_limit
self
.
wait_on_rate_limit_notify
=
wait_on_rate_limit_notify
self
.
parser
=
parser
or
ModelParser
()
self
.
proxy
=
{}
if
proxy
:
self
.
proxy
[
'https'
]
=
proxy
""" statuses/home_timeline """
home_timeline
=
bind_api
(
...
...
tweepy/binder.py
View file @
f334323e
...
...
@@ -154,7 +154,7 @@ def bind_api(**config):
try
:
resp
=
self
.
session
.
request
(
self
.
method
,
full_url
,
data
=
self
.
post_data
,
timeout
=
self
.
api
.
timeout
,
auth
=
auth
)
auth
=
auth
,
proxies
=
self
.
api
.
proxy
)
except
Exception
,
e
:
raise
TweepError
(
'Failed to send request: %s'
%
e
)
rem_calls
=
resp
.
headers
.
get
(
'x-rate-limit-remaining'
)
...
...
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