-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled streaming toots (fix #84) #86
Conversation
@schochastics I will give it a try. |
close(con) | ||
close(output) | ||
}) | ||
invisible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schochastics Would it be better to return an invisible file_name
here (the same for all stream_*
functions)? It would be quite useful when the input path
(or file_name
for stream_*
) is NULL
(the default). If file_name
doesn't get returned, one can probably never get the path of that temp file (unless going through all temp files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases like this:
x <- stream_timeline_public(10)
One can never get the file back. (We might implement a parse
parameter in the future, akin rtweet::stream_tweets
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah i didnt quite understand what the parsing does in rtweet? Let me try to fix this. We shouldnt loose toots in tempfiles😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Their parse
is just to return a tibble if TRUE
and NULL if FALSE
; kind of similar to the parse
parameter of our get_*
functions. Maybe we can do better to return a tibble if TRUE
and the (actual) file_name
if FALSE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does rtweet not loose track of the tmp file? https://github.com/ropensci/rtweet/blob/master/R/stream.R#L83-L88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gets echoed. If you prefer, it can also be a solution.
https://github.com/ropensci/rtweet/blob/14c89649e152f1c1609f9dc3d65234dbf2560d8e/R/stream.R#L71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i think i prefer to echo the tmp file name and not return anything. The parsing should be done when reading the json. I will push something later as a suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schochastics Sure thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chainsawriot Ok done. tmp file is now only echoed. I encourgae users in the vignette to always set a file_name
So that it is the same as `get_timeline_hashtag`
oh boy thanks for cleaning my mess :D |
@schochastics From my view, I think it's working and can be merged. The rest is #87 |
This enables streaming toots live.
@chainsawriot, just gonna leave this open for a bit in case you want to have a look/make suggestions.