def __init__(self, auth_handler=None,
host='api.twitter.com', search_host='search.twitter.com',
cache=None, secure=True, api_root='/1.1', search_root='',
- retry_count=0, retry_delay=0, retry_errors=None,
+ retry_count=0, retry_delay=0, retry_errors=None, timeout=60,
parser=None):
self.auth = auth_handler
self.host = host
self.retry_count = retry_count
self.retry_delay = retry_delay
self.retry_errors = retry_errors
+ self.timeout = timeout
self.parser = parser or ModelParser()
""" statuses/home_timeline """
# Open connection
# FIXME: add timeout
if self.api.secure:
- conn = httplib.HTTPSConnection(self.host)
+ conn = httplib.HTTPSConnection(self.host,timeout=self.api.timeout)
else:
- conn = httplib.HTTPConnection(self.host)
+ conn = httplib.HTTPConnection(self.host,timeout=self.api.timeout)
# Apply authentication
if self.api.auth: