Skip to content

Commit

Permalink
only kobe fails
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Sep 27, 2023
1 parent c022176 commit 51db0f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/psl.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public_suffix <- function(url) {
dom <- mapply(function(x, y) sub(x, "", y), pat, url[with_wildcard][idx], USE.NAMES = FALSE)
idy <- .has_dot(dom)
suffix_match[with_wildcard][idx][idy] <- paste0(sub(".*\\.([^\\.]+)$", "\\1", dom[idy]), ".", suffix_match[with_wildcard][idx][idy])
suffix_match[with_wildcard][idx][!idy] <- host[with_wildcard][idx][!idy]
suffix_match[with_wildcard][idx][!idy] <- host[idx][!idy]
}
suffix_match
}
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
7 changes: 3 additions & 4 deletions data-raw/psl.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
psl <- readLines("https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat")
psl <- psl[1:which(psl == "// ===BEGIN PRIVATE DOMAINS===")]
psl <- psl[!grepl("^//", psl) & psl != ""]

wildcard <- psl[grepl("^\\*", psl)]
wildcard <- stringr::str_remove(wildcard, "\\*\\.")

fixed <- psl[!grepl("^\\*", psl)]
raw_list <- c(fixed, wildcard)
rev_raw_list <- sapply(raw_list, url_reverse)
rev_raw_list <- sapply(paste0(".", raw_list), url_reverse)
psl <- list("raw_list" = raw_list, "wildcard" = wildcard, "rev_raw_list" = rev_raw_list)

# trie_ps <- triebeard::trie(sapply(raw_list, url_reverse), raw_list)
# psl <- list("trie_ps" = trie_ps, "wildcard" = wildcard, "raw" = raw_list)

usethis::use_data(psl, overwrite = TRUE, internal = TRUE)

0 comments on commit 51db0f5

Please sign in to comment.