Skip to content

Rate Limit Exceeded with Fast argument ON #24

@ebravofm

Description

@ebravofm

Hi!

I'm running this snippet on a csv file containing 200 user names:

library("tweetbotornot")
rts <- read.csv(file="rts.csv", header=TRUE, sep=",")
data <- tweetbotornot(rts$Twitter.Name, fast = TRUE)

I'm setting the fast argument on, however I'm getting this error:

Warning message:
“Rate limit exceeded - 88”
Error in if (n%/%200 < n.times) {: argument is of length zero
Traceback:

  1. botornot(rts$Twitter.Name, fast = TRUE)
  2. botornot.factor(rts$Twitter.Name, fast = TRUE)
  3. botornot(x, fast = fast)
  4. botornot.character(x, fast = fast)
  5. rtweet::get_timelines(x, n = 100)
  6. get_timeline(user, n, max_id, home, parse, check, token, ...)
  7. do.call("get_timeline_", args)
  8. get_timeline_(user = c("---list of users---), n = 100, home = FALSE, max_id = NULL,
    . parse = TRUE, check = TRUE, token = NULL)
  9. Map(get_timeline_call, user = user, n = n, home = home, MoreArgs = dots)
  10. mapply(FUN = f, ..., SIMPLIFY = FALSE)
  11. (function (user, n = 200, max_id = NULL, home = FALSE, parse = TRUE,
    . check = TRUE, token = NULL, ...)
    . {
    . stopifnot(is_n(n), is.atomic(user), is.atomic(max_id), is.logical(home))
    . if (home) {
    . query <- "statuses/home_timeline"
    . }
    . else {
    . query <- "statuses/user_timeline"
    . }
    . if (length(user) > 1) {
    . stop("can only return tweets for one user at a time.",
    . call. = FALSE)
    . }
    . token <- check_token(token)
    . if (check) {
    . rl <- rate_limit(token, query)
    . n.times <- rl[["remaining"]]
    . if (n%/%200 < n.times) {
    . n.times <- ceiling(n/200L)
    . }
    . }
    . else {
    . rl <- NULL
    . n.times <- ceiling(n/200L)
    . }
    . if (n.times == 0L) {
    . if (!is.null(rl)) {
    . reset <- round(as.numeric(rl[["reset"]], "mins"),
    . 2)
    . }
    . else {
    . reset <- "An unknown number of"
    . }
    . warning("rate limit exceeded. ", round(reset, 2), " mins until rate limit resets.",
    . call. = FALSE)
    . return(data.frame())
    . }
    . if (n < 200) {
    . count <- n
    . }
    . else {
    . count <- 200
    . }
    . params <- list(user_type = user, count = count, max_id = max_id,
    . tweet_mode = "extended", ...)
    . names(params)[1] <- .id_type(user)
    . url <- make_url(query = query, param = params)
    . tm <- scroller(url, n, n.times, type = "timeline", token)
    . if (parse) {
    . tm <- tweets_with_users(tm)
    . }
    . tm
    . })(user = dots[[1L]][[1L]], n = dots[[2L]][[1L]], home = dots[[3L]][[1L]],
    . max_id = NULL, parse = TRUE, check = TRUE, token = NULL)

Am i doing something wrong?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions