# Requires a bearer token
if (FALSE) {
# How many rules do we have
stream_add_rule(NULL)
# Add new rule
new_rule <- stream_add_rule(list(value = "#rstats", tag = "rstats"))
new_rule
# Open filtered streaming connection for 30s
filtered_stream(file = tempfile(), timeout = 30, parse = FALSE)
# Remove rule
stream_rm_rule(ids(new_rule))
# Open random streaming connection
sample_stream(file = tempfile(), timeout = 3, parse = FALSE)
}
Run the code above in your browser using DataLab