"Connection to Twitter stream was closed after 0 seconds with up to 1 tweets downloaded" message


#1

Hi,

Please forgive me as I am fairly new in trying to make use of API’s in general. I am trying to access the streaming API but receive the following:

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

I am attempting this through R and the package streamR. I do not believe authentication is an issue because I am able to make use functions from the twitteR package. I am not sure how to solve this, any help is appreciated.


#2

I am not sure what is wrong with this account, but creating a new account and attempting this worked.


#3

Can you provide us the sample http request and response that you receive? Also, if you can share your R code it will also be helpful for us.


#4

I’m having the same problem since the last 3 days.
One month ago it was ok. I’m wondering if any Twitter filter stops/breaks my connection due to some algorithm.

The HTTP request is made by streamR and it can be read easily on github or cran-r:

My code is so simple using streamR in ‘R Studio’ to get data:

filterStream(file.name = "filename.json", follow=users, language=c("en"), timeout=60, oauth = my_oauth)

where ‘users’ is a list of screen_name, anyway even if I choose ‘users’ as ids it is the same.

The API responds intermittently even with these (but some time I got data):

1) filterStream(filename, locations=c(-xx,-xx,xx,xx), timeout = timeout, tweets=tweets, oauth = my_oauth)
2) filterStream(file.name = "filename.json", tweets=tweets, language=c("en"), timeout=60, oauth = my_oauth)

The apps I’m using for the oauth are: Sviluporeale, v4lerio.org, DM-Pj2
The same problem with all apps.

Any solutions or explanation?

Update

Today 21-Feb-2015, from 15:49 to 17:45, I made the following request (except for the first 2 rows, for which the request was 1Mln):

filterStream("filename.json", locations=c(-180,-90,180,90), language=c("it","en"), tweets=100000, oauth = my_oauth)

Here the respected responses:
Connection to Twitter stream was closed after 503 seconds with up to 25828 tweets downloaded.
Connection to Twitter stream was closed after 297 seconds with up to 13681 tweets downloaded.
Connection to Twitter stream was closed after 184 seconds with up to 10256 tweets downloaded.
Connection to Twitter stream was closed after 33 seconds with up to 878 tweets downloaded.
Connection to Twitter stream was closed after 98 seconds with up to 4052 tweets downloaded.
Connection to Twitter stream was closed after 99 seconds with up to 4121 tweets downloaded.
Connection to Twitter stream was closed after 18 seconds with up to 700 tweets downloaded.
Connection to Twitter stream was closed after 16 seconds with up to 447 tweets downloaded.
Connection to Twitter stream was closed after 28 seconds with up to 850 tweets downloaded.

So why the connection was automatically closed?


#5

Are there any updates to solve this issue?