Closed cwarny closed 8 years ago
@robturtle Did you see this? https://github.com/SpiderStrategies/node-tweet-stream/pull/40
@cwarny Could you please add one line yourTwitterStreamInstance.on('error', function (err) { console.log(err) })
to check what specific error it is?
{ type: 'http',
err: [Error: Twitter connection error 406],
explain:
{ type: 'not-acceptable',
long: 'At least one request parameter is invalid.' } }
Note that I use the exact same credentials as in 1.10.0, and it works fine in the latter.
Can you provide the parameters you passed to the tracking function. Since the change from 1.10.0 to 2.0.0 doesn't change the logic of parameter handling, my current guess is maybe some of your parameters are invalid in the code but the old version just emit 'reconnect' silently. Give me your passing parameters so I can verify this. You can also check for yourself by printing out all statusCode of responses.
Well, not sure it's appropriate to share my Twitter credentials... It's just an object with the following keys:
{
consumer_key: process.env.TWITTER_CONSUMER_KEY_DEV,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET_DEV,
token: process.env.TWITTER_TOKEN_DEV,
token_secret: process.env.TWITTER_TOKEN_SECRET_DEV
}
I think I found the problem. My bad. I was setting the language of my twitter stream instance without specifying a track. Feel free to close this.
@cwarny Cool. Thanks for the update.
@cwarny By saying parameters I didn't mean the credentials but the parameters passed to the twitter API. This reminds me that maybe the explanations can be more specific than current, and adding a default 'error' handler may reduce the confusions. I will create a PR for that later.
Upgraded to 2.0 and getting this error as soon as I try to connect to the Twitter stream. With same credentials, same code, when I downgrade to 1.10.0, it works fine. This happens on
this.emit( "error")
line