From 3252eab8bc9e3fea369db316aea318d7da0d8782 Mon Sep 17 00:00:00 2001 From: Janez K Date: Tue, 15 Apr 2014 00:08:56 +0200 Subject: [PATCH] fixed twython dependency --- requirements.txt | 2 +- tap.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index a166b66..0b47b32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ oauthlib==0.6.1 requests==2.1.0 requests-oauthlib==0.4.0 supervisor==3.0 -git+https://github.com/janezkranjc/twython.git +twython==3.1.2 diff --git a/tap.py b/tap.py index 9688298..dca501b 100755 --- a/tap.py +++ b/tap.py @@ -146,7 +146,7 @@ def save_tweets(statuses): p = urlparse.urlparse(refresh_url) new_since_id = dict(urlparse.parse_qsl(p.query))['since_id'] queries.update({'query':query,'geocode':geocode,'lang':lang},{"$set":{'since_id':new_since_id}},upsert=True) - logger.debug("Rate limit for current window: "+str(results['headers']['x-rate-limit-remaining'])) + logger.debug("Rate limit for current window: "+str(twitter.get_lastfunction_header(header="x-rate-limit-remaining"))) save_tweets(results['statuses']) next_results = results['search_metadata'].get('next_results') @@ -155,7 +155,7 @@ def save_tweets(statuses): next_results_max_id = dict(urlparse.parse_qsl(p.query))['max_id'] results = perform_query(q=query,geocode=geocode,lang=lang,count=100,since_id=since_id,max_id=next_results_max_id,result_type=result_type) next_results = results['search_metadata'].get('next_results') - logger.debug("Rate limit for current window: "+str(results['headers']['x-rate-limit-remaining'])) + logger.debug("Rate limit for current window: "+str(twitter.get_lastfunction_header(header="x-rate-limit-remaining"))) save_tweets(results['statuses']) since_id = new_since_id \ No newline at end of file