rtweet (version 0.1.4)

TWIT: TWIT

Description

Base function responsible for formulating GET and POST requests to Twitter API's.

Usage

TWIT(get = TRUE, url, ..., timeout = NULL, filename = NULL, catch_error = TRUE)

Arguments

get
Logical with the default, get = TRUE, indicating whether the provided url should be passed along via a GET or POST request.
url
Character vector designed to operate like parse_url and build_url functions in the httr package. The easiest way to do this is to work through the call-specific functions as they are designed to simplify the process. However, if one were interested in reverse- engingeering such a thing, I would recommend checking out make_url.
timeout
Numeric, used only when streaming tweets, specifying the number of seconds to stream tweets.
filename
Character, used only when streaming tweets, name of file to save json tweets object.
catch_error
Logical indicating whether to call stop for status function following GET or POST requests.
...
Further named parameters, such as config, token, etc, passed on to modify_url in the httr package.

Value

json response object

Examples

Run this code
## Not run: 
# tokens <- get_tokens()
# 
# params <- list(q = "rstats", result_type = "recent")
# 
# url <- make_url(restapi = TRUE,
#   "search/tweets",
#   param = params)
# 
# r <- TWIT(get = TRUE, url,
#   config = tokens[[1]])
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace