1

I'm working on a small web app project that uses ParseHub to scrape web data and display it on my site using d3.js. However, according to ParseHub API, they only return JSON data in gzip content-encoding format. I want to find a way to inflate the compressed content to JSON and feed it directly in my d3 model. I've tried poke and JXGcompressor which I found from threads on this site, but neither worked, not sure if it's because I used them wrong. Please help me! Thank you!

Below is the response I got:

{"statusCode":200,"body":"\u001f�\b\b\u0000��V\u0002\u0003tzRbY-385ECKLE7qbgihaY6U\u0000�\\[s��r�+��ڷ�j��umي��9�CjLA\"J �
...
=���|�='�7�k\u0001x)��\n�ʸ\u000b\u00125���B9�D��vf�/��h{����:\u0017[̅A\u0004���$��\u0015���\u001et��ÈVB5����Ь���\u000fh�Nr\u0000\u0000","headers":{"server":"nginx/1.8.0","date":"Wed, 30 Mar 2016 22:54:17 GMT","content-type":"application/json","content-length":"6549","connection":"close","content-encoding":"gzip","last-modified":...}
Stella
  • 139
  • 3
  • 14

1 Answers1

1

Found a super easy answer, this saved my life!!!!

Ryan Knell posted this answer here: Easy HTTP requests with gzip/deflate compression

All I needed was to include gzip: true in my request, because request already supports it: https://github.com/request/request

kohane15
  • 809
  • 12
  • 16
Stella
  • 139
  • 3
  • 14