rtweet (version 0.1.7)

search_tweets: search_tweets

Description

Returns a collection of relevant Tweets matching a specified query.

Usage

search_tweets(q, count = 100, type = "mixed", token = NULL, ...)

Arguments

q

Character vector search query of no greater than 500 characters maximum.

count

Numeric specifying the number of desired tweets to return per page. Defaults to maximum, which is 100.

type

Character, specifies what type of search results you would prefer to receive. The current default is type = "mixed". Valid values include type = "mixed" to include both popular and real time results in the response, type = "recent" to return only the most recent results in the response, and type = "popular" to return only the most popular results in the response.

token

OAuth token (1.0 or 2.0). By default token = NULL fetches a non-exhausted token from an environment variable tokens.

Futher arguments passed on to make_url.

Value

Tweets data returned as a tibble data_frame

See Also

https://dev.twitter.com/overview/documentation

Examples

Run this code
# NOT RUN {
# search for 1000 tweets mentioning Hillary Clinton
hrc <- search_tweets(q = "hillaryclinton", count = 1000)
hrc

# search for 1000 tweets mentioning Donald Trump
djt <- search_tweets(q = "realdonaldtrump", count = 1000)
djt
# }

Run the code above in your browser using DataLab