Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wget download script helper function #198

Open
dmullen17 opened this issue Oct 11, 2019 · 0 comments
Open

Add wget download script helper function #198

dmullen17 opened this issue Oct 11, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@dmullen17
Copy link
Member

dmullen17 commented Oct 11, 2019

Add a helper function that does something similar to this script:

pkg <- get_package(adc, 'resource_map_doi:10.5065/D61J97TT', file_names = T)
pid_to_wget <- function(pid) {
  return(paste0('wget --no-check-certificate https://arcticdata.io/metacat/d1/mn/v2/object/', pid, ' -O ', names(pid), '\n'))
}

pids <- c(pkg$metadata, pkg$data)
text <- vector('character', length(pids))
for (i in seq_along(pids)) {
  text[i] <- pid_to_wget(pids[i])
}
formatted_text <- paste0(text, collapse = '')
write(formatted_text, file = '/home/dmullen/Submissions/Merrelli/download.sh')

A couple more details are available here: NCEAS/arcticdatautils#145

@dmullen17 dmullen17 added the enhancement New feature or request label Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant