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

Problems with some feeds #3

Open
nd2s opened this issue Feb 1, 2014 · 7 comments
Open

Problems with some feeds #3

nd2s opened this issue Feb 1, 2014 · 7 comments

Comments

@nd2s
Copy link

nd2s commented Feb 1, 2014

Hi,

I'm getting a lot of "EOF" errors on some feeds, and sometimes no new tweets at all. For instance this one isn't working for me at all: 97475886 (acmc_clock_euro).

Also: sometimes empty tweets are returned.

Example code:

conn, err := client.Follow(someId)
[...]
for {
    tweet, err := conn.Next()
    if err != nil {
        fmt.Printf("%#v\n", err)
        conn.Close()
        return
    }
    fmt.Printf("Got Tweet: %#v\n", *tweet)
}
@darkhelmet
Copy link
Owner

It will lose the connection eventually if you get nothing, or even during regular operation. If Twitter or something else kills the connection, it just dies.

Check out https://github.com/darkhelmet/twitterstream/blob/master/twimgd/twimgd.go#L159

You have to loop on the outside to reconnect, possibly waiting before reconnecting.

As for as the empty tweets, is that reproducible? I honestly don't use the Follow method myself but I'll check it out.

@darkhelmet
Copy link
Owner

Do you mean the tweet is nil? Or the tweet is there but everything is empty?

@nd2s
Copy link
Author

nd2s commented Feb 3, 2014

I see. Could be a bit of a problem: connecting takes nearly up to a minute sometimes (is that a Twitter API problem or one of the package? Seems a bit long...). Would that mean I would loose a lot of tweets if I have to reconnect every few minutes?

I meant empty object, not nil. It only happens rarely. Could be that it only occurs directly before an EOF, but I'm not sure on that.

@nd2s
Copy link
Author

nd2s commented Feb 3, 2014

Yeah, pretty sure now that it's always happening before an EOF.

@darkhelmet
Copy link
Owner

Hmm, taking a minute to connect shouldn't be the package but Twitter or something along the way. There is some timeout related stuff, where by default it sets a read timeout of 1 minute when reading/decoding tweets. There's also a 5 second dial timeout.

@nd2s
Copy link
Author

nd2s commented Feb 3, 2014

Read timeout is working fine. The client.Follow(id) is blocking very long - but returns without error.
Not sure how I can test that.

@darkhelmet
Copy link
Owner

Hmm, I'll look at it

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

2 participants