Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

search_30day() returns find.id() error #713

Closed
aterhorst opened this issue May 23, 2022 · 2 comments
Closed

search_30day() returns find.id() error #713

aterhorst opened this issue May 23, 2022 · 2 comments

Comments

@aterhorst
Copy link

aterhorst commented May 23, 2022

Problem

I have elevated API access. The sandbox package allows me to access tweets from the past 30 days. However, when executing search_30day() I get an error.

Expected behavior

I expect to have a data frame returned with tweets from the last 30 days.

Reproduce the problem

## insert code here

auth_as("my_app")  # Same name as appname on Twitter Developer site.

tweets30 <- search_30day(q = "advanced recycling", env_name = "my_app")
Error in `find_id()`:
! `max_id` must be a character vector or data frame
Run `rlang::last_error()` to see where the error occurred.

rlang::last_error()
<error/rlang_error>
Error in `find_id()`:
! `max_id` must be a character vector or data frame
---
Backtrace:
 1. rtweet::search_30day(q = "advanced recycling", env_name = "social_licence")
 2. rtweet:::search_premium(...)
 3. rtweet:::TWIT_paginate_max_id(...)
 4. rtweet::max_id(max_id)
 5. rtweet:::find_id(x, "max_id")
Run `rlang::last_trace()` to see the full context.

rlang::last_trace()
<error/rlang_error>
Error in `find_id()`:
! `max_id` must be a character vector or data frame
---
Backtrace:1. └─rtweet::search_30day(q = "advanced recycling", env_name = "social_licence")
 2.   └─rtweet:::search_premium(...)
 3.     └─rtweet:::TWIT_paginate_max_id(...)
 4.       └─rtweet::max_id(max_id)
 5.         └─rtweet:::find_id(x, "max_id")
 6.           └─rlang::abort(paste0("`", arg_name, "` must be a character vector or data frame"))

rtweet version

## copy/paste output
packageVersion("rtweet")
[1] ‘0.7.0.9029

Session info

## copy/paste output
sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.3.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] wordcloud_2.6      RColorBrewer_1.1-3 topicmodels_0.2-12 rtweet_0.7.0.9029  qdapRegex_0.7.5    tidytext_0.3.2     forcats_0.5.1      stringr_1.4.0      dplyr_1.0.9       
[10] purrr_0.3.4        readr_2.1.2        tidyr_1.2.0        tibble_3.1.7       ggplot2_3.3.6      tidyverse_1.3.1   

loaded via a namespace (and not attached):
 [1] httr_1.4.3        bit64_4.0.5       jsonlite_1.8.0    modelr_0.1.8      assertthat_0.2.1  stats4_4.1.3      cellranger_1.1.0  progress_1.2.2    slam_0.1-50      
[10] pillar_1.7.0      backports_1.4.1   lattice_0.20-45   glue_1.6.2        digest_0.6.29     rvest_1.0.2       colorspace_2.0-3  Matrix_1.4-0      plyr_1.8.7       
[19] tm_0.7-8          pkgconfig_2.0.3   broom_0.8.0       haven_2.5.0       scales_1.2.0      tzdb_0.3.0        generics_0.1.2    farver_2.1.0      ellipsis_0.3.2   
[28] withr_2.5.0       NLP_0.2-1         cli_3.3.0         magrittr_2.0.3    crayon_1.5.1      readxl_1.4.0      tokenizers_0.2.1  janeaustenr_0.1.5 fs_1.5.2         
[37] fansi_1.0.3       SnowballC_0.7.0   xml2_1.3.3        tools_4.1.3       prettyunits_1.1.1 hms_1.1.1         lifecycle_1.0.1   munsell_0.5.0     reprex_2.0.1     
[46] compiler_4.1.3    rlang_1.0.2       grid_4.1.3        rstudioapi_0.13   labeling_0.4.2    gtable_0.3.0      DBI_1.1.2         curl_4.3.2        reshape2_1.4.4   
[55] R6_2.5.1          lubridate_1.8.0   bit_4.0.4         utf8_1.2.2        modeltools_0.2-23 stringi_1.7.6     parallel_4.1.3    Rcpp_1.0.8.3      vctrs_0.4.1      
[64] dbplyr_2.1.1      tidyselect_1.1.2 
@aterhorst aterhorst changed the title search_30day() returns max.id error search_30day() returns find.id error May 23, 2022
@aterhorst aterhorst changed the title search_30day() returns find.id error search_30day() returns find.id() error May 23, 2022
@llrs
Copy link
Collaborator

llrs commented May 23, 2022

I think the problem is on TWIT_paginate_max_id or max_id and might be fixed at the same time than #578 (where you already reported this). When I looked into it, I couldn't fix it, I hope to find the root cause and fix it before the release on CRAN.

By the way, it is always good to verify if a bug is fixed, it could be inadvertently fixed and I would appreciate someone to let me know. But if I don't update/comment an issue is that I couldn't make progress on it.

@aterhorst
Copy link
Author

Yes. I am exploring the functionality of the development version of rtweet and reporting issues as I encounter these. There are some significant changes from version 0.7.0. I suspect the changes have to do with V2 of the Twitter API. Thanks very much for maintaining rtweet. I can see you have taken over as the main package maintainer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants