edsu/twarc — pull request #16 by anarchivist (2014-09-21 21:49:24+00:00)
Title: Fix missing import for scrape mode

When trying to run `twarc --scrape hashtag`, I ran into an issue where a missing explicit import for `requests` was leading to the error below. This fixes that by adding `requests` as an explicit import and an explicit requirement.

```
$ CONSUMER_KEY="foo" CONSUMER_SECRET="bar" ACCESS_TOKEN="baz" ACCESS_TOKEN_SECRET="quux" twarc.py --scrape hashtag
Traceback (most recent call last):
File "/usr/local/bin/twarc.py", line 5, in
pkg_resources.run_script('twarc==0.0.7', 'twarc.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/twarc-0.0.7-py2.7.egg/EGG-INFO/scripts/twarc.py", line 287, in
archive(args.query, tweets)
File "/usr/local/lib/python2.7/dist-packages/twarc-0.0.7-py2.7.egg/EGG-INFO/scripts/twarc.py", line 201, in archive
for status in statuses:
File "/usr/local/lib/python2.7/dist-packages/twarc-0.0.7-py2.7.egg/EGG-INFO/scripts/twarc.py", line 123, in search
for status in scrape_tweets(q, max_id=max_id):
File "/usr/local/lib/python2.7/dist-packages/twarc-0.0.7-py2.7.egg/EGG-INFO/scripts/twarc.py", line 214, in scrape_tweets
for tweet_id in scrape_tweet_ids(query, max_id, sleep=1):
File "/usr/local/lib/python2.7/dist-packages/twarc-0.0.7-py2.7.egg/EGG-INFO/scripts/twarc.py", line 237, in scrape_tweet_ids
r = requests.get(url, params=q)
NameError: global name 'requests' is not defined
```