|
|
@ -149,7 +149,7 @@ class TwitterNetworkData(NetworkData): |
|
|
|
if 'in_reply_to_status_id' in data and data['in_reply_to_status_id']: |
|
|
|
if 'in_reply_to_status_id' in data and data['in_reply_to_status_id']: |
|
|
|
owner = NetworkUser() |
|
|
|
owner = NetworkUser() |
|
|
|
owner.username = data['in_reply_to_screen_name'] |
|
|
|
owner.username = data['in_reply_to_screen_name'] |
|
|
|
self.parent = int(data['in_reply_to_status_id']) |
|
|
|
self.parent = data['in_reply_to_status_id'] |
|
|
|
self.parent_owner = owner |
|
|
|
self.parent_owner = owner |
|
|
|
|
|
|
|
|
|
|
|
if 'retweeted_status' in data: |
|
|
|
if 'retweeted_status' in data: |
|
|
@ -308,10 +308,14 @@ class Connection(NetworkBase): |
|
|
|
# Introduced in Twitter in 2009.03.27 |
|
|
|
# Introduced in Twitter in 2009.03.27 |
|
|
|
response_headers = response.info() |
|
|
|
response_headers = response.info() |
|
|
|
if 'X-RateLimit-Remaining' in response_headers: |
|
|
|
if 'X-RateLimit-Remaining' in response_headers: |
|
|
|
self._rate_limit = int(response_headers['X-RateLimit-Remaining']) |
|
|
|
rate = response_headers['X-RateLimit-Remaining'].split(',')[0] |
|
|
|
|
|
|
|
_log.debug('X-RateLimit-Remaining: %s', rate) |
|
|
|
|
|
|
|
self._rate_limit = int(rate) |
|
|
|
_log.debug('Remaning hits: %d', self._rate_limit) |
|
|
|
_log.debug('Remaning hits: %d', self._rate_limit) |
|
|
|
elif 'x-ratelimit-remaining' in response_headers: |
|
|
|
elif 'x-ratelimit-remaining' in response_headers: |
|
|
|
self._rate_limit = int(response_headers['x-ratelimit-remaining']) |
|
|
|
rate = response_headers['x-ratelimit-remaining'].split(',')[0] |
|
|
|
|
|
|
|
_log.debug('x-ratelimit-remaining: %s', rate) |
|
|
|
|
|
|
|
self._rate_limit = int(rate) |
|
|
|
_log.debug('Remaning hits: %d', self._rate_limit) |
|
|
|
_log.debug('Remaning hits: %d', self._rate_limit) |
|
|
|
else: |
|
|
|
else: |
|
|
|
self._rate_limit = None |
|
|
|
self._rate_limit = None |
|
|
|