hrbrmstr / ipapi

An R package to geolocate IPv4/6 addresses and/or domain names using ip-api.com's API
Other
24 stars 6 forks source link

fixing issue with `success` variable #3

Closed cbdavis closed 8 years ago

cbdavis commented 8 years ago

The success variable isn't a boolean (anymore? because of httr changes?). In any case, this fixes the issue I encounter when running:

geolocate(c(NA, "10.0.1.1", "", "72.33.67.89", "dds.ec", " ", "search.twitter.com"), .progress=FALSE)

Error in if (success) { : argument is not interpretable as logical

I've also updated the time delay between requests since I got banned when using Sys.sleep(0.15). Assuming no latency at all in addition to instantaneous API responses, 0.15*150 requests = 22.5 seconds. I'm currently using Sys.sleep(0.4) which means that 150 requests take >= 60 seconds which is right at the limit that they set.

hrbrmstr commented 8 years ago

ty but you should use the new rgeolocate pkg (which is also in CRAN). Local or API-geolocation wrapped in a single pkg for multiple services.

cbdavis commented 8 years ago

Thanks for the notice, I hadn't heard about the new package.