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

Invalid 'time' error with using get_friends() #277

Closed
Rgoodsell opened this issue Jul 26, 2018 · 4 comments
Closed

Invalid 'time' error with using get_friends() #277

Rgoodsell opened this issue Jul 26, 2018 · 4 comments

Comments

@Rgoodsell
Copy link

Invalid 'time' error with using get_friends()

Using get_friends() for large numbers (5000) returns the error:

Error in Sys.sleep(reset + 2) : invalid 'time' value

as in #168

Reproduce the problem

Code run, messages & errors as follows:

library(devtools) 
install_github("mkearney/rtweet")
library(rtweet)

hWt <- search_tweets(
  "#heatwave" ,n=18000,include_rts = FALSE
)

hWt_following <- get_friends(unique(hWt$screen_name),retryonratelimit = TRUE, token = bearer_token())

1 friend networks collected!
2 friend networks collected!
3 friend networks collected!
4 friend networks collected!
5 friend networks collected!
6 friend networks collected!
7 friend networks collected!
8 friend networks collected!
9 friend networks collected!
10 friend networks collected!
11 friend networks collected!
12 friend networks collected!
13 friend networks collected!
14 friend networks collected!
15 friend networks collected!
Waiting about 14.5 minutes for rate limit reset...
Waiting about -0.4 minutes for rate limit reset...
Error in Sys.sleep(as.numeric(rl$reset, "secs") + 2) : 
  invalid 'time' value


rtweet version

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

Session info

## copy/paste output
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] rtweet_0.6.7.9000 devtools_1.13.6   openssl_0.9.6    

loaded via a namespace (and not attached):
 [1] digest_0.6.12  crayon_1.3.4   withr_2.1.2    R6_2.2.2       jsonlite_1.5  
 [6] git2r_0.22.1   magrittr_1.5   pillar_1.3.0   httr_1.3.1     rlang_0.2.1   
[11] curl_2.6       rstudioapi_0.7 tools_3.4.0    compiler_3.4.0 memoise_1.1.0 
[16] knitr_1.16     tibble_1.4.2  

Token

## copy/paste output
rtweet::get_token()
<Token>
<oauth_endpoint>
 request:   https://api.twitter.com/oauth/request_token
 authorize: https://api.twitter.com/oauth/authenticate
 access:    https://api.twitter.com/oauth/access_token
<oauth_app> rg_r*
  key:    ZFWe*
  secret: <hidden>
<credentials> oauth_token, oauth_token_secret, user_id, screen_name
@mkearney
Copy link
Collaborator

Looks like I need to add a seconds must be positive condition. Will do soon!

@Bisaloo
Copy link

Bisaloo commented May 10, 2020

I have the same issue with search_tweets()

@apriandito
Copy link

Have the same issue with get_followers()

@llrs
Copy link
Collaborator

llrs commented Feb 15, 2021

This seems fixed on the current version, or at least I didn't see any negative seconds waiting.

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

5 participants