Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Bad token #38

Open
Fabryz opened this issue Apr 29, 2014 · 7 comments
Open

Error: Bad token #38

Fabryz opened this issue Apr 29, 2014 · 7 comments

Comments

@Fabryz
Copy link

Fabryz commented Apr 29, 2014

Hi,
sometimes I have these errors on the stream and the app stops to retrieve tweets from the streaming API, the process is still running though.

https://gist.github.com/Fabryz/3f244dd3f47a3423ed06

I think that the problem may rely in:

  • some unicode encoded characters
  • the fact that sometimes the JSON is not correctly merged from the chunks arrived on the streaming api. If you see on "gistfile2.txt" the JSON seems broken.

Is there a way to just skip this kind of event and let the stream go on? Without having to use the reconnection

@JalalAlbasri
Copy link

Here's what I do but it's not ideal, I have a problem of tweet stream stopping for a while. I think it might be getting throttled because I am reconnecting every time after these bad token errors.

function startTwitterServer() {
        tuiter = new Tuiter(keys);
        console.log('Starting Twitter Stream.');

        tuiter.filter(
                {locations: [{lat: -90, long: -180},{lat: 90, long: 180}]},
                function(stream){

                stream.on('tweet', function(data) {
                      console.log(data.text);

                });

                stream.on('error', function(error, data) {
                        console.log("Stream error");

                        console.log(error);
                        startTwitterServer();
                })
        });
}

@impronunciable
Copy link
Owner

The problem is twitter is now sending parts of tweets on different chunks. Some time ago they sent full tweets on every chunk. I'll fix it for the next version.

@Fabryz
Copy link
Author

Fabryz commented May 16, 2014

@danzajdband Any news? :)

@impronunciable
Copy link
Owner

I'll review it at weekend. Sorry for the delay.

On Fri, May 16, 2014 at 4:53 AM, Fabrizio Codello
notifications@github.comwrote:

@danzajdband https://github.com/danzajdband Any news? :)

Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-43306004
.

Dan Zajdband

@mwesto
Copy link

mwesto commented Jul 22, 2014

when the new version is coming plz ?

@montogeek
Copy link

Yeah. when? :P

@impronunciable
Copy link
Owner

haha. I'll forget about this. If it's still persisting I'll take a look but help is welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants