Skip to content

Commit

Permalink
Try httr's hostname extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
gittaca authored Jul 19, 2020
1 parent fba627d commit 3165342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/parse_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#'
parse_url <- function(url){
match <-
stringr::str_match(url, "(^\\w+://)?([\\w.]+)?(/.*)?")[, -1, drop = FALSE]
httr::parse_url(url)$hostname

df <- as.data.frame(match, stringsAsFactors = FALSE)
names(df) <- c("protocol", "domain", "path")
Expand Down

0 comments on commit 3165342

Please sign in to comment.