MathildeLemee/hubot-twitter — pull request #19 by mikegroseclose (2014-06-27 00:35:41+00:00)
Title: Bug/correctly handle response chunks to avoid SyntaxError

* Need to ensure all data is received before trying to run JSON parse or else will end up getting a ‘[SyntaxError: Unexpected token’.
* Since data might come in chunks need to concatenate the chunks wait for a carriage return / newline before parsing.
* Also fixed whitespace since CoffeeScript is sensitive to spacing.
* To make the changes easier to read (due to all the whitespace changes, you can use ?w=1 to the URL to see the diff with whitespace ignored. First commit is code changes, second commit is whitespace.)