casmlab / get-nytimes-articles

Python tools for getting data from the New York Times Article API. Retrieves JSON from the API, stores it, parses it into a CSV file.
MIT License
46 stars 25 forks source link

Error At End of News Day #1

Closed AdamOlsonMN closed 10 years ago

AdamOlsonMN commented 10 years ago

Your NYT api wrapper seems like it would work perfectly for part of my own work but I keep getting a weird error when I try to run it. I've attached the testing log that it outputs but it is basically this again and again: ERROR:root:IOError in 19700107 page 63: 2 No such file or directory.

I have modified the search query to the following:

request_string = "http://api.nytimes.com/svc/search/v2/articlesearch.json?q=%22Earned+Income+Tax+Credit%22" + date + "&end_date=" + date + "&page=" + str(page) + "&api-key=" + api_key

For reference, this is the string I am running at the CLI with API key included:

python pullarticles.py -j /vagrant/nyt/articles -c /vagrant/nyt/file.csv -k APIKEY

I am running Ubuntu through a vagrant instance of a virtual machine. I don't think this is the problem though as I sometimes get a few hits. I am moderately familiar with Python and have played around with the Twitter API before but I can't figure this out.

That query works in the NYT API console and spits out similar results in the archive search as well.

Thanks!