Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Set limits to get_liked_tweets? #346

Answered by d-schafer
d-schafer asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I figured it out. I created a custom get_user_edges function and then told academictwitteR to use it instead of the original.

First, I added a few new lines to the get_user_edges function. I put them below the if clause that checks if the next token is null. I'm including the whole code chunk here:

      if (is.null(next_token)) {
        if(verbose) {
          cat("This is the last page for ",
              x[i],
              ": finishing collection. \n")
        }
        break
      }
#these are the new lines designed to catch requests that have gotten more than 30000 Tweets back.
      if (nrow(new_df) > 30000) {
        cat("30,000 Tweet limit reached for ", x[i], ": ending c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by d-schafer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant