R / Twitter Live Streaming: Error: The stream disconnected prematurely

Viewed 797

I would need to keep collecting tweets to live stream data and show insights in Power BI.

I have the following R code to stream tweets continuously. It tries to scrap tweets every 10 seconds. After first 10-14 times, it throws an error:

The stream disconnected prematurely. Reconnecting... 

Below is the code:

q <- "maths"
streamtime <- 10 
filename <- "test.json"
rt <- stream_tweets(q = q, timeout = streamtime, file_name = filename)

How do I overcome this limitation?

0 Answers
Related