Giter VIP home page Giter VIP logo

Comments (4)

sevetseh28 avatar sevetseh28 commented on June 26, 2024

I think the issue lies on this part of the code:
image

it's getting the most recent 100 tweets without taking into account the fast parameter!

from tweetbotornot.

Hawkeye407 avatar Hawkeye407 commented on June 26, 2024

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.

from tweetbotornot.

sevetseh28 avatar sevetseh28 commented on June 26, 2024

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).
image

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!

from tweetbotornot.

Jupaoqq avatar Jupaoqq commented on June 26, 2024

@sevetseh28 @Hawkeye407

  1. delete this package (tweetbotornot) from your R packages library
  2. Fork this Repo
  3. in (whatever your github username is)/tweetbotornot/R/tweetbotornot.R, in line 89 to 96, change

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)
}

  1. commit those changes
  2. open a R session, then do

library(devtools)
install_github("(whatever your github username is)/tweetbotornot", dependencies = TRUE)

  1. Run your R script

I've also opened a pull request to make those changes to this repo to fix this issue.

from tweetbotornot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.