-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freegeoip API endpoint needs updated #115
Comments
mmm, I'm not sure if there is a solution for this...
…----------------Contact
Details:-------------------------------------------------------
Tal Galili, Ph.D. in Statistics
[email protected]
www.r-statistics.com (English)
www.biostatistics.co.il (Hebrew) | www.talgalili.com (Hebrew)
----------------------------------------------------------------------------------------------
On Tue, Jul 31, 2018 at 5:47 PM, kng229 ***@***.***> wrote:
Attempts to use freegeoip() now result in:
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") : cannot open URL 'http://freegeoip.net/json/
155.186.245.217' : HTTP status was '403 Forbidden'
If you navigate to http://freegeoip.net/json/155.186.245.217 in your
browser, you receive this prompt:
{
"0": "###########################################################
######################################################################",
"1": "# #",
"2": "# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #",
"3": "# #",
"4": "# This API endpoint is deprecated and has now been shut down. To
keep using the freegeoip API, please update your integration #",
"5": "# to use the new ipstack API endpoint, designed as a simple drop-in
replacement. #",
"6": "# You will be required to create an account at https://ipstack.com
and obtain an API access key. #",
"7": "# #",
"8": "# For more information on how to upgrade please visit our Github
Tutorial at: https://github.com/apilayer/freegeoip#readme #",
"9": "# #",
"a": "###########################################################
######################################################################"
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#115>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7khnxj-hT6HYWAyc3ZwPlT8g-5DyBoks5uMG4cgaJpZM4VoZow>
.
|
I was able to get it to work using newip <- function (df = NULL) where XXXXX is my access key. I also set it to only pull region and country, which are the variables that I was concerned with but it could easily be generalized |
Cool, could you commit the diff for me to review?
…----------------Contact
Details:-------------------------------------------------------
Tal Galili, Ph.D. in Statistics
[email protected]
www.r-statistics.com (English)
www.biostatistics.co.il (Hebrew) | www.talgalili.com (Hebrew)
----------------------------------------------------------------------------------------------
On Fri, Aug 3, 2018 at 6:36 PM, kng229 ***@***.***> wrote:
I was able to get it to work using
newip <- function (df = NULL)
{
if (is.data.frame(df) == FALSE) {
warning("This function only works with data.frames. Please provide a
data.frame.")
}
else {
final <- data.frame()
for (i in 1:nrow(df)) {
url <- paste("http://api.ipstack.com/", c(as.character(df[i,
])), "?access_key=XXXXXXXX&output=json&legacy=1", sep = "")
line <- tryCatch(fromJSON(getURLContent(url)),
error = function(e) e)
country <- ifelse(is.null(line[[3]]), NA, line[[3]])
region <- ifelse(is.null(line[[5]]), NA, line[[5]])
out <- data.frame(country, region)
final <- rbind(final, out)
}
return(final)
}
}
where XXXXX is my access key. I also set it to only pull region and
country, which are the variables that I was concerned with but it could
easily be generalized
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7khnGGaGfXJ1jMZIG85BRGwDaC6alpks5uNG3ugaJpZM4VoZow>
.
|
Attempts to use freegeoip() now result in:
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") : cannot open URL 'http://freegeoip.net/json/155.186.245.217' : HTTP status was '403 Forbidden'
If you navigate to http://freegeoip.net/json/155.186.245.217 in your browser, you receive this prompt:
{
"0": "#################################################################################################################################",
"1": "# #",
"2": "# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #",
"3": "# #",
"4": "# This API endpoint is deprecated and has now been shut down. To keep using the freegeoip API, please update your integration #",
"5": "# to use the new ipstack API endpoint, designed as a simple drop-in replacement. #",
"6": "# You will be required to create an account at https://ipstack.com and obtain an API access key. #",
"7": "# #",
"8": "# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/freegeoip#readme #",
"9": "# #",
"a": "#################################################################################################################################"
}
The text was updated successfully, but these errors were encountered: