zachwill/rottentomatoes — pull request #4 by devrelm (2014-01-03 03:18:04+00:00)
Title: support gzip-encoded responses from the RT api

The [Rotten Tomatoes API Forums](http://developer.rottentomatoes.com/forum) are full of people complaining about errors while parsing the json result. [It looks like](http://developer.rottentomatoes.com/forum/read/156340/2) there is an error where some of their servers are responding with a gzipped json string.

`urlopen()` does not automatically decompress this, so `json.loads()` gets confused and errors out.

The changes I've made will first attempt to decompress the string using `zlib`, and then will deserialize the json from there.