Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

stream_tweets() stops collecting before the declared timeout #263

Closed
IsobelleClarke opened this issue Jun 29, 2018 · 3 comments
Closed

stream_tweets() stops collecting before the declared timeout #263

IsobelleClarke opened this issue Jun 29, 2018 · 3 comments

Comments

@IsobelleClarke
Copy link

Problem

I declared the time collecting tweets to be a week long (604800 seconds) but it stopped after only a few hours.

Expected behavior

I expected it to stop collecting Tweets after a week. To check how long it was running again I have just re-ran it (but this time to check on 4 hours) which resulted in the programme stopping after in less than an hour (see below)

Reproduce the problem

 Sys.time()
[1] "2018-06-29 11:47:57 BST"
generalTwitter_start18.6.29_11.47<- stream_tweets(q = "", timeout = 14400, parse = TRUE, file_name = "generalEngTweets_18.6.29_11.47", verbose = TRUE, language="en")
Streaming tweets for 14400 seconds...
Downloading: 120 MB     Finished streaming tweets!
opening file input connection.
 Imported 7751 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 7948 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 8871 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 9094 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 8979 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 8976 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 8993 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 8659 records. Simplifying...
closing file input connection.
opening file input connection.
 Imported 7227 records. Simplifying...
closing file input connection.
streaming data saved as generalEngTweets_18.6.29_11.47.json
Sys.time()
[1] "2018-06-29 12:22:20 BST"
@mkearney
Copy link
Collaborator

It could be caused on Twitter's end, but it may also be related to the status checks that Twitter sends back. @IsobelleClarke can you share your sessionInfo()?

@rayms
Copy link

rayms commented Jul 23, 2018

@IsobelleClarke, I wonder if you managed to resolve this problem? I am experiencing it as well. The slight wrinkle, in my case, is that the stream seems to stop or hang up (as far as I can tell), e.g. something like, Downloading: 19 MB gets stuck in the console and the expected JSON file is much smaller than anticipated.

@IsobelleClarke
Copy link
Author

@mkearney @rayms
Sorry for not replying sooner @mkearney!

The problem (I think) actually ended up being the result of the computer needing to restart and update. I think it was the pop-up message that was causing the programme stop running. After restarting and updating the computer it collected with no interruptions, although I am yet to check the size of file and the tweets in their for the dates. However, I checked a couple of hours before it was due to stop and it was still collecting so that seems good to me. Perhaps @rayms you could try restarting. Otherwise, I'm not really sure, have you set the timeout right? Maybe post your code here and @mkearney can help.

@llrs llrs mentioned this issue Feb 15, 2021
@llrs llrs closed this as completed Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants