getTimeline: Returns up to 3,200 recent tweets from a given user

Description Usage Arguments Author(s) Examples

View source: R/get-timeline.R

Description

getTimeline connects to the REST API of Twitter and returns up to 3,200 recent tweets sent by these user. If the total number of tweets sent by this user is less than 3,200 tweets, it will return all tweets.

Usage

1
2
3
getTimeline(filename, n = 3200, oauth, screen_name = NULL, id = NULL,
  since_id = NULL, trim_user = "false", tweet_mode = "extended",
  sleep = 0.5, verbose = FALSE)

Arguments

filename

file where tweets will be stored (in json format)

n

number of tweets to be downloaded (maximum is 3,200)

oauth

One of the following: either a list with details for an access token (see example below), a folder where OAuth tokens are stored, or a csv file with the format: consumer_key, consumer_secret, access_token, access_token_secret.

screen_name

user name of the Twitter user for which his/her tweets will be downloaded

id

id of Twitter user for which his/her tweets will be downloaded (Use either of these two arguments)

since_id

id of the oldest tweet to be downloaded. Useful if, for example, we're only interested in getting tweets sent after a certain date.

trim_user

if "true", downloaded tweets will include user object embedded. If "false", only tweet information will be downloaded.

tweet_mode

if "extended", will return up to 280 characters per tweet.

sleep

numeric, number of seconds between API calls. Higher number will increase reliability of API calls; lower number will increase speed.

verbose

If TRUE, provides additional output in console about API rate limits

Author(s)

Pablo Barbera P.Barbera@lse.ac.uk

Examples

1
2
3
4
5
## Not run: 
## Download recent tweets by user "p_barbera"
 friends <- getTimeline(screen_name="p_barbera", oauth=my_oauth)

## End(Not run)

lingeringcode/tweetscoresmod documentation built on Feb. 18, 2020, 5:28 p.m.