Skip to content

Commit

Permalink
Pair programming URL accommodation adds
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Oct 30, 2024
1 parent 03d1065 commit e31bfbb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/url-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ get_urls <- function(file) {
urls <- unlist(url_list)

# Remove trailing characters
urls <- gsub("\\'\\:$|\\'|\\:$|\\.$", "", urls)
urls <- gsub("\\'\\:$|\\'|\\:$|\\.$|\\)$|\\,$", "", urls)

# Remove URLs that are in the ignore
if( ignore_urls[1] != "") urls <- grep(paste0(ignore_urls, collapse = "|"), urls, invert = TRUE, value = TRUE)

if (length(urls) > 0 ){
# Remove trailing characters
Expand All @@ -150,8 +153,7 @@ get_urls <- function(file) {
all_urls <- lapply(files, get_urls)

# Write the file
all_urls_df <- dplyr::bind_rows(all_urls) %>%
dplyr::filter(!(urls %in% ignore_urls))
all_urls_df <- dplyr::bind_rows(all_urls)

if (nrow(all_urls_df) > 0) {
all_urls_df <- all_urls_df %>%
Expand Down

0 comments on commit e31bfbb

Please sign in to comment.