ntwitter icon indicating copy to clipboard operation
ntwitter copied to clipboard

incorrect oauth requests for search streams

Open jamescauwelier opened this issue 13 years ago • 2 comments

When I try to start a search stream with track=test,test'ing it fails.

track=test works fine track=test,test'ing => 401 error

The response I receive is a 401 and I suspect that when POST 'ing the oauth is not done correctly.

Please let me know what extra information I can provide to further debug this issue?

jamescauwelier avatar Sep 20 '12 14:09 jamescauwelier

I have found what actually is causing the issue in a related ticket: https://github.com/ciaranj/node-oauth/issues/113#issuecomment-8734434

jamescauwelier avatar Sep 21 '12 08:09 jamescauwelier

It 's not fixed by calling this.oauth.post with a stringified version of the parameters.

This explains why: https://github.com/ciaranj/node-oauth/issues/113#issuecomment-8761268

For now, I have forked oauth and ntwitter and implemented the fix in oauth. That is quite hacky and the reason why I didn 't do a pull request of it. The change could break oauth in other library apart from twitter.

Op 27-sep.-2012, om 02:10 heeft David Lee het volgende geschreven:

Has the issue been resolved? Any solutions? I tried copying and pasting your solution, but it still didn't work:

var url = stream_base + '/' + escape(method) + '.json';

// to stringify to fix problems with ' characters in track parameter var stringified_params = querystring.stringify(params); stringified_params = stringified_params .replace(/!/g, "%21") .replace(/'/g, "%27") .replace(/(/g, "%28") .replace(/)/g, "%29") .replace(/*/g, "%2A");

var request = this.oauth.post( url, this.options.access_token_key, this.options.access_token_secret, stringified_params, null );

— Reply to this email directly or view it on GitHub.

jamescauwelier avatar Sep 27 '12 09:09 jamescauwelier