Description Usage Arguments Value References Examples
Streams public statuses to a file via one of the following four methods:
Sampling a small random sample of all publicly available tweets
Filtering via a search-like query (up to 400 keywords)
Tracking via vector of user ids (up to 5000 user_ids)
Location via geo coordinates (1-360 degree location boxes)
Learn more in vignette("stream", package = "rtweet")
1 2 3 4 5 6 7 8 9 10 |
q |
Query used to select and customize streaming collection method. There are four possible methods:
|
timeout |
Integer specifying number of seconds to stream tweets for.
Stream indefinitely with The stream can be interrupted at any time, and |
parse |
Use |
token |
Expert use only. Use this to override authentication for
a single API call. In most cases you are better off changing the
default for all calls. See |
file_name |
Character with name of file. If not specified,
will write to |
verbose |
If |
append |
If |
... |
Other arguments passed in to query parameters. |
A tibble with one row per tweet
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/sample-realtime/api-reference/get-statuses-sample, https://developer.twitter.com/en/docs/twitter-api/v1/tweets/filter-realtime/overview
Stream: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/sample-realtime/api-reference/get-statuses-sample Filter: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/filter-realtime/api-reference/post-statuses-filter
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
# stream tweets mentioning "election" for 10 seconds
e <- stream_tweets("election", timeout = 10)
e
# Download another 10s worth of data to the same file
e <- stream_tweets("election", timeout = 10)
# stream tweets about continential USA for 5 minutes
usa <- stream_tweets(lookup_coords("usa"), file_name = "usa.json", timeout = 300)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.