Skip to content

Commit

Permalink
Add check_png_urls()
Browse files Browse the repository at this point in the history
  • Loading branch information
howardbaek committed Jul 10, 2023
1 parent 2131ede commit 22b7f13
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/download_gs_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ make_slide_url <- function(x) {
x
}

# Check if vector of URLs is valid (Status Code = 200)
check_png_urls <- function(urls) {
res = vapply(urls, function(url) {
tfile = tempfile(fileext = ".png")
ret = httr::GET(url)
httr::status_code(ret) == 200
}, FUN.VALUE = logical(1))
return(res)
}

# Extract page IDs of slides in a Google Slides presentation
#' @importFrom jsonlite fromJSON
#' @import httr
Expand Down

0 comments on commit 22b7f13

Please sign in to comment.