Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Water
dataRetrieval
Commits
a18719e8
Commit
a18719e8
authored
Nov 19, 2021
by
Laura A DeCicco
Browse files
Need to actually *call* the new function!
parent
40647168
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/getWebServiceData.R
View file @
a18719e8
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#' }
#' }
getWebServiceData
<-
function
(
obs_url
,
...
){
getWebServiceData
<-
function
(
obs_url
,
...
){
if
(
!
curl
::
has_internet
(
))
{
if
(
!
has_internet
_2
(
obs_url
))
{
message
(
"No internet connection."
)
message
(
"No internet connection."
)
return
(
invisible
(
NULL
))
return
(
invisible
(
NULL
))
}
}
...
@@ -111,11 +111,7 @@ default_ua <- function() {
...
@@ -111,11 +111,7 @@ default_ua <- function() {
#' @keywords internal
#' @keywords internal
#' @param obs_url character obs_url to check
#' @param obs_url character obs_url to check
has_internet_2
<-
function
(
obs_url
)
{
has_internet_2
<-
function
(
obs_url
)
{
# For now, we know exactly where we're sending our queries
# But, if we expose a setter, we'll probably need to move it
# to the url construction, set a host in the package enviornment?,
# or come up with some better regex here:
host
<-
gsub
(
"^https://(?:www[.])?([^/]*).*$"
,
"\\1"
,
obs_url
)
host
<-
gsub
(
"^https://(?:www[.])?([^/]*).*$"
,
"\\1"
,
obs_url
)
!
is.null
(
curl
::
nslookup
(
host
,
error
=
FALSE
))
!
is.null
(
curl
::
nslookup
(
host
,
error
=
FALSE
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment