SpiderStrategies / node-tweet-stream

Node twitter module to hook into the public filter streaming, seamlessly updating the tracking keywords.
210 stars 43 forks source link

Adds support for gzip and deflate compression #42

Open mvdwalle opened 8 years ago

mvdwalle commented 8 years ago

Twitter can support gzip compression. I added the option gzip: true to the request and added code to handle either gzip, deflate or none.

I took a quick look at how the tests were set up and I could create tests for this if wanted. But I wanted someone to review first.

nathanbowser commented 8 years ago

This seems reasonable to me. Have you been using this branch in your own work?

I'd like to see an opt-in approach to this, though.

e.g.

new Twitter({
    consumer_key: '',
    consumer_secret: '',
    token: '',
    token_secret: ''
  }, {
   gzip: true // defaults to false to prevent any potential breakage. 
  })
mvdwalle commented 8 years ago

I chanegd the pull request as suggested. This change is one of a few that we are or want to use internally at my company.

nathanbowser commented 8 years ago

Awesome, thanks! I'd say once you write some tests, we can get this merged.

fourpixels commented 7 years ago

Any news? Is this still supported?

nathanbowser commented 7 years ago

Module is supported. Waiting on tests for this PR