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

Sandbox feature Issues #358

Closed
Elikran opened this issue Sep 30, 2019 · 1 comment
Closed

Sandbox feature Issues #358

Elikran opened this issue Sep 30, 2019 · 1 comment
Labels

Comments

@Elikran
Copy link

Elikran commented Sep 30, 2019

Problem

Using Sandbox 30 day or full archive, when I pull 100 tweets, I can only get the most recent tweets and it pulls 99 not 100. Is there a way to get a random sample of the last 30 days, or does the API only pull the most recent tweets? Is this simply my misunderstanding of the twitter API? or is there a way to force it to pull a random sample?

Expected behavior

I expect a random sample of tweets in the last 30 days, but I only get the last day, after it pulls 100 tweets.

Reproduce the problem

sampledow <-search_30day(q = "#dowjones",
n = 100,
fromDate = "NULL",
toDate = "NULL",
env_name = "sandbox",
parse = TRUE,
token =NULL,
safedir = NULL)


### rtweet version

<!-- run the code below and copy/paste the output -->

``` r
## copy/paste output
> packageVersion("rtweet")
[1] ‘0.6.9’

Session info

 sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] openssl_1.4.1  dplyr_0.8.3    ggplot2_3.2.1  tidytext_0.2.2 httpuv_1.5.2   rtweet_0.6.9  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2        pillar_1.4.2      compiler_3.6.1    later_0.8.0       prettyunits_1.0.2 progress_1.2.2    tokenizers_0.2.1 
 [8] tools_3.6.1       digest_0.6.21     zeallot_0.1.0     jsonlite_1.6      tibble_2.1.3      gtable_0.3.0      lattice_0.20-38  
[15] pkgconfig_2.0.3   rlang_0.4.0       Matrix_1.2-17     curl_4.2          withr_2.1.2       janeaustenr_0.1.5 httr_1.4.1       
[22] askpass_1.1       generics_0.0.2    vctrs_0.2.0       hms_0.5.1         grid_3.6.1        tidyselect_0.2.5  glue_1.3.1       
[29] R6_2.4.0          purrr_0.3.2       magrittr_1.5      backports_1.1.4   scales_1.0.0      promises_1.0.1    SnowballC_0.6.0  
[36] assertthat_0.2.1  colorspace_1.4-1  labeling_0.3      stringi_1.4.3     lazyeval_0.2.2    munsell_0.5.0     crayon_1.3.4     

Token

rtweet::get_token()

request: https://api.twitter.com/oauth/request_token authorize: https://api.twitter.com/oauth/authenticate access: https://api.twitter.com/oauth/access_token *********** key: *********************** secret: oauth_token, oauth_token_secret
@llrs llrs mentioned this issue Feb 15, 2021
@llrs llrs added the bug label Feb 16, 2021
@hadley
Copy link
Collaborator

hadley commented Feb 27, 2021

I don't see any evidence on https://developer.twitter.com/en/docs/twitter-api/premium/search-api/api-reference/premium-search that API provides some way to get a random selection of tweets, and I can't think of any way that rtweet could implement random sampling itself.

@hadley hadley closed this as completed Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants