ropensci-archive / rtweet

🐦 R client for interacting with Twitter's [stream and REST] APIs
https://docs.ropensci.org/rtweet
Other
786 stars 201 forks source link

get_my_timeline displays incorrect created_at date #448

Closed sbw78 closed 3 years ago

sbw78 commented 4 years ago

Problem

get_my_timeline returns today's date for created_at column instead of statuses' actual created date

For example, a status with a creation date of "2019-02-04 18:06:15" instead has a creation date of "2020-10-01 14:08:05" (whatever the current date-time is) when the function is run.

get_timeline does not have this issue.

Expected behavior

created_at should be the date at which the status was created, not the date it was accessed via rtweet.

Reproduce the problem

rtweet::get_my_timeline()

rtweet version

rtweet version 0.7.0

Session info

R version 3.6.3 (2020-02-29)
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] shiny_1.5.0         ggraph_2.0.3        ggplot2_3.3.2       rtweet_0.7.0       
 [5] tidytext_0.2.5      tm_0.7-7            NLP_0.2-0           purrr_0.3.4        
 [9] tidyr_1.1.2         dplyr_1.0.2         knitr_1.29          lubridate_1.7.9    
[13] sbwtools_0.0.0.9004 here_0.1            rmarkdown_2.3       drake_7.12.5       
[17] fnmate_0.0.1        dotenv_1.0.2        conflicted_1.0.4   

loaded via a namespace (and not attached):
  [1] colorspace_1.4-1    ellipsis_0.3.1      rprojroot_1.3-2     htmlTable_2.0.1    
  [5] base64enc_0.1-3     fs_1.5.0            rstudioapi_0.11     farver_2.0.3       
  [9] graphlayouts_0.7.0  SnowballC_0.7.0     ggrepel_0.8.2       fansi_0.4.1        
 [13] xml2_1.3.2          splines_3.6.3       polyclip_1.10-0     Formula_1.2-3      
 [17] jsonlite_1.7.1      cluster_2.1.0       png_0.1-7           ggforce_0.3.2      
 [21] clipr_0.7.0         compiler_3.6.3      httr_1.4.2          backports_1.1.9    
 [25] fastmap_1.0.1       assertthat_0.2.1    Matrix_1.2-18       cli_2.0.2          
 [29] later_1.1.0.1       tweenr_1.0.1        htmltools_0.5.0     prettyunits_1.1.1  
 [33] tools_3.6.3         igraph_1.2.5        gtable_0.3.0        glue_1.4.2         
 [37] Rcpp_1.0.5          slam_0.1-47         vctrs_0.3.4         xfun_0.16          
 [41] stringr_1.4.0       ps_1.3.4            miniUI_0.1.1.1      mime_0.9           
 [45] lifecycle_0.2.0     MASS_7.3-52         scales_1.1.1        tidygraph_1.2.0    
 [49] hms_0.5.3           promises_1.1.1      parallel_3.6.3      RColorBrewer_1.1-2 
 [53] yaml_2.2.1          curl_4.3            memoise_1.1.0       gridExtra_2.3      
 [57] rpart_4.1-15        latticeExtra_0.6-29 stringi_1.4.6       tokenizers_0.2.1   
 [61] checkmate_2.0.0     filelock_1.0.2      storr_1.2.1         rlang_0.4.7.9000   
 [65] pkgconfig_2.0.3     evaluate_0.14       lattice_0.20-41     htmlwidgets_1.5.1  
 [69] processx_3.4.4      tidyselect_1.1.0    magrittr_1.5        R6_2.4.1           
 [73] generics_0.0.2      Hmisc_4.4-1         base64url_1.4       txtq_0.2.3         
 [77] whisker_0.4         pillar_1.4.6        foreign_0.8-76      withr_2.2.0        
 [81] survival_3.2-3      nnet_7.3-14         tibble_3.0.3        janeaustenr_0.1.5  
 [85] crayon_1.3.4        utf8_1.1.4          viridis_0.5.1       jpeg_0.1-8.1       
 [89] progress_1.2.2      grid_3.6.3          data.table_1.13.0   callr_3.4.4        
 [93] reprex_0.3.0        digest_0.6.25       xtable_1.8-4        httpuv_1.5.4       
 [97] openssl_1.4.3       munsell_0.5.0       viridisLite_0.3.0   askpass_1.1        

Token

sbw********** key: Qubd*****************
hadley commented 3 years ago

This now looks ok to me:

library(dplyr, warn.conflicts = FALSE)

rtweet::get_my_timeline() %>% 
  select(status_id, created_at, screen_name, text)
#> # A tibble: 92 x 4
#>    status_id     created_at          screen_name  text                          
#>    <chr>         <dttm>              <chr>        <chr>                         
#>  1 136565089957… 2021-02-27 13:12:01 pycoders     "Python Concurrency: The Tric…
#>  2 136564966753… 2021-02-27 13:07:07 KimFlaggSel… "Today MGB highlights Ranthon…
#>  3 136564679113… 2021-02-27 12:55:42 abtran       "Hey, here's your dose of mea…
#>  4 136564412035… 2021-02-27 12:45:05 vboykis      "@vboykis Definitely call me …
#>  5 136564123526… 2021-02-27 12:33:37 vboykis      "@vboykis Call me when AI has…
#>  6 136563889334… 2021-02-27 12:24:19 vboykis      "Call me when AI has figured …
#>  7 136563622150… 2021-02-27 12:13:42 vboykis      "Pattern Matching (PEP 634-63…
#>  8 136562754824… 2021-02-27 11:39:14 hadleywickh… "@yutannihilat_en It would be…
#>  9 136564229396… 2021-02-27 12:37:49 hadleywickh… "@carroll_jono I mean out of …
#> 10 136564388151… 2021-02-27 12:44:08 hadleywickh… "@smartin2018 @romunov @gdbas…
#> # … with 82 more rows

Created on 2021-02-27 by the reprex package (v1.0.0)