Open sevetseh28 opened 6 years ago
I think the issue lies on this part of the code:
it's getting the most recent 100 tweets without taking into account the fast parameter!
Hi, I have the same problem, I think that the reason for the error is that you exceed twitter API. I am using FAST parameter too and in the documentation is that you can call 90 000 calls... but it's not working for me, my limit with FAST parameter is 180, same without.
In my case error looks like:
Warning: /1.1/statuses/user_timeline.json - Not authorized. Warning: /1.1/statuses/user_timeline.json - Not authorized. Warning: /1.1/statuses/user_timeline.json - Not authorized. Warning: /1.1/statuses/user_timeline.json - Not authorized. Warning: Rate limit exceeded - 88 Error in if (n%/%200 < n.times) { : argument is of length zero
My theory is that during the analyze I reach API limit.
Clearly, the problem is that the script is not considering the FAST param at all. You can see that it is getting the user's timelime (/1.1/statuses/user_timeline.json endpoint is the user's timeline).
botornot should receive fast = fast I guess, Im not an expert in R though.
Anyway, I have already tried hardcoding the default parameter to TRUE but I'm getting another error:
Error: Columns `user_id`, `screen_name` not found Call `rlang::last_error()` to see a backtrace
Output of summary(rlang::last_error()):
<error>
message: Columns `user_id`, `screen_name` not found
class: `rlang_error`
fields: `message`, `trace` and `parent`
backtrace:
x
\-tweetbotornot::tweetbotornot(users, fast = TRUE)
+-tweetbotornot::botornot(x, fast = TRUE)
\-tweetbotornot:::botornot.character(x, fast = TRUE)
+-tweetbotornot::botornot(x, fast = fast)
\-tweetbotornot:::botornot.data.frame(x, fast = fast)
+-base::unique(x[, c("user_id", "screen_name")])
+-x[, c("user_id", "screen_name")]
\-tibble:::`[.tbl_df`(x, , c("user_id", "screen_name"))
+-tibble:::check_names_df(j, x)
\-tibble:::check_names_df.character(j, x)
\-tibble:::check_names_before_after.character(j, names(x))
\-tibble:::stopc(pluralise_msg("Column(s) ", unknown_names), " not found")
@mkearney could you give us a hand here?? Thank you!
@sevetseh28 @Hawkeye407
botornot.character <- function(x, fast = FALSE) { x <- x[!is.na(x) & !duplicated(x)] x <- rtweet::get_timelines(x, n = 100) botornot(x, fast = fast) }
to
botornot.character <- function(x, fast = FALSE) { x <- x[!is.na(x) & !duplicated(x)] if (fast) { x <- rtweet::lookup_users(x) } else { x <- rtweet::get_timelines(x, n = 100) } botornot(x, fast = fast) }
library(devtools) install_github("(whatever your github username is)/tweetbotornot", dependencies = TRUE)
I've also opened a pull request to make those changes to this repo to fix this issue.
Hi! I'm getting this error from the Twitter API:
Warning: /1.1/statuses/user_timeline.json - Not authorized.
Im calling the script with the Fast parameter set to true, so it shouldn't get the user's timeline, right?
data <- tweetbotornot(users, fast=TRUE)