tw_api_get_statuses_user_timeline: Gets status updates (tweets) from a given user

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/twitter_api.R

Description

Using the twitter API, gets the status updates of a given user (up to 3,200)

Usage

1
2
3
tw_api_get_statuses_user_timeline(screen_name = NULL, twitter_token,
  user_id = NULL, since_id = NULL, count = 100, max_id = NULL,
  exclude_replies = NULL, include_rts = NULL, quietly = FALSE, ...)

Arguments

screen_name

of the user

twitter_token

An object of class Token1.0 as generated by tw_gen_token.

user_id

The ID of the user for whom to return results for

since_id

Returns results with an ID greater than (that is, more recent than) the specified ID

count

Number of statuses to get

max_id

Returns results with an ID less than (that is, older than) or equal to the specified ID

exclude_replies

This parameter will prevent replies from appearing in the returned timeline

include_rts

When set to false, the timeline will strip any native retweets

quietly

Whether or not to show the 'success' message

...

Additional arguments passed to GET()

Details

This function is designed to be applied to a large list of twitter accounts, see the example below.

From twitter

Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.

Value

A data.frame with tweets (if success), with the following columns:

otherwise returns NULL.

Author(s)

George G. Vega Yon

References

Twitter REST API (GET statuses/user_timeline) https://dev.twitter.com/rest/reference/get/statuses/user_timeline

See Also

tw_extract()

Other API functions: tw_api_get_followers_ids, tw_api_get_followers_list, tw_api_get_friends_ids, tw_api_get_search_tweets, tw_api_get_statuses_sample, tw_api_get_trends_place, tw_api_get_users_search, tw_api_get_users_show, tw_api_trends_available, tw_gen_token

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# List of twitter accounts
users <- c('MarsRovers', 'senatormenendez', 'sciencemagazine')

# Getting the twitts (first gen the token)
key <- tw_gen_token('myapp','key', 'secret')
tweets <- lapply(users, tw_api_get_statuses_user_timeline, twitter_token=key)

# Processing the data (and taking a look)
tweets <- do.call(rbind, tweets)
head(tweets)

## End(Not run)

gvegayon/twitterreport documentation built on May 17, 2019, 9:30 a.m.