Title: | Downloads Tweets from a List of Tweet IDs |
---|---|
Description: | Facilitates replication of Twitter-based research by handling common programming tasks needed when downloading tweets. Specifically, it ensures a user does not exceed Twitter’s rate limits, and it saves tweets in moderately sized files. While a user could perform these tasks in their own code, doing so may be beyond the capabilities of many users. |
Authors: | Kevin Coakley [aut, cre], Zachary Steinert-Threlkeld [ctb] |
Maintainer: | Kevin Coakley <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 0.5.2 |
Built: | 2025-01-21 03:24:04 UTC |
Source: | https://github.com/kevincoakley/rehydrator |
Get tweets for given statuses (tweet IDs).
rehydratoR(consumer_key, consumer_secret, access_token, access_secret, status_ids, base_path = NULL, group_start = 1)
rehydratoR(consumer_key, consumer_secret, access_token, access_secret, status_ids, base_path = NULL, group_start = 1)
consumer_key |
Consumer Key (API Key) from https://apps.twitter.com/ |
consumer_secret |
Consumer Secret (API Secret) from https://apps.twitter.com/ |
access_token |
Access Token from the https://apps.twitter.com/ |
access_secret |
Access Token Secret from https://apps.twitter.com/ |
status_ids |
data frame of tweet IDs |
base_path |
optional. The base path to use to save the tweets. If set, the function will write the tweets to files instead of returning the tweets as a variable. |
group_start |
is the group to start at after splitting list of ids. Is useful in case the download was interrupted. |
A tibble of tweets data if base_path is not defined. Nothing is returned if base_path is defined but the tweets are saved to a file for about every 90,0000 tweets.
## Not run: # Get Twitter api keys from https://apps.twitter.com consumerKey <- '' consumerSecret <- '' accessToken <- '' accessTokenSecret <- '' # Read tweet ids tweet_ids <- data.frame(read.table(tweet_ids_file, numerals = 'no.loss')) # Download tweets tweets <- rehydratoR(consumerKey, consumerSecret, accessToken, accessTokenSecret, tweet_ids) ## End(Not run)
## Not run: # Get Twitter api keys from https://apps.twitter.com consumerKey <- '' consumerSecret <- '' accessToken <- '' accessTokenSecret <- '' # Read tweet ids tweet_ids <- data.frame(read.table(tweet_ids_file, numerals = 'no.loss')) # Download tweets tweets <- rehydratoR(consumerKey, consumerSecret, accessToken, accessTokenSecret, tweet_ids) ## End(Not run)