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

偶尔善良 提交于 2020-04-13 17:14:06

问题


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?

来源:https://stackoverflow.com/questions/53145933/r-twitter-live-streaming-error-the-stream-disconnected-prematurely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!