TWIT

0th

Percentile

TWIT

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

Note

Occasionally Twitter does recommend using POST requests for data retrieval calls. This is usually the case when requests can involve long strings (containing up to 100 user_ids). For the most part, or at least for any function-specific requests (e.g., get_friends, take reflect these changes.

Aliases
  • TWIT
Examples
# 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]])
# }
Documentation reproduced from package rtweet, version 0.1.7, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.