Trying to consume stream but getting back "Exceeded connection limit for user"


I’m using the ROAuth and streamR libraries for R.

First I had trouble connecting to Twitter, see Then I’ve been trying to get a stream filtered to show 10 tweets mentioning “Jeremy Corbyn”; this is how I did it:

              track='"jeremy corbyn"', tweets=10, oauth=my_oauth )

tweets.df <- parseTweets("jeremy_corbyn.json")

At first when I tried running this, it waited for about 200 seconds. I don’t remember running the second command that time. After that, every time I’ve run it I’ve got back

Capturing tweets…
Connection to Twitter stream was closed after 1 seconds with up to 1 tweets downloaded.


Error in parseTweets(“jeremy_corbyn.json”) :
“jeremy_corbyn.json” did not contain any tweets. See ?parseTweets for more details.

I’ve even tried waiting 15 minutes and I get the same thing.

The contents of “jeremy_corbyn.json” are:

Exceeded connection limit for user
Exceeded connection limit for user
Exceeded connection limit for user
Exceeded connection limit for user

Why is this happening and how do I get it to work?


I can’t be much help because I don’t know R - I don’t understand that language at all. But the Stream is a live data stream, so I’m not sure what your plan is for getting 10 tweets is (is the R program you’re running going to disconnect after it receives 10 tweets?). You’re tracking “jeremy corbyn”, so it depends on how often someone writes that while you’re connected to the Stream.

You can only have 1 connection to the Stream. Is it possible the first connection did not close? That would explain the “Exceeded connection limit for user” errors you were getting on subsequent connection attempts.