zeroviscosity/guardian-article-fetcher — pull request #1 by hugovk (2014-10-04 19:31:44+00:00)
Title: Two fixes

1. It seems the API requires an API key now. When I called it for the first time with defaults I got an error in the response saying a key was needed. So, if the response is an error, print out the message. It could raise some error too, but I let it just continue because at least it's printing something out.

2. There's a bug with `max_pages`. Documented as: "This the only paramenter that is not passed along to The Guardian API. If `max_pages` is left at 0, then it will retrieve as many pages as possible. Otherwise it will retrieve the minimum of the total number of pages avaible and `max_pages`." However, if it's left at it's default 0, the script returns the min of `max_pages` i.e. 0 and the number of pages returned by the API: so nothing is output. Instead, a special case is needed for when `max_pages` is 0.