mirror of https://git.sr.ht/~hrbrmstr/vershist
boB Rudis
5 years ago
11 changed files with 91 additions and 3 deletions
@ -0,0 +1,36 @@ |
|||
#' Retrieve ISC BIND Version Release History |
|||
#' |
|||
#' Reads <https://ftp.isc.org/isc/bind9/> to build a data frame of |
|||
#' ISC BIND version release numbers and dates. NOTE that BIND version strings |
|||
#' are ugly (despite their commitment to semantic versioning) so this function |
|||
#' returns the BIND version (`vers`), the release date (`rls_date`) and release year |
|||
#' (`rls_year`) arranged in order from lowest version to latest version and |
|||
#' the `vers` column is an ordered factor. |
|||
#' |
|||
#' @md |
|||
#' @export |
|||
isc_bind_version_history <- function() { |
|||
|
|||
bind_dir <- xml2::read_html("https://ftp.isc.org/isc/bind9/") |
|||
|
|||
rvest::html_nodes(bind_dir, xpath = ".//tr[contains(., '9.')]") %>% |
|||
map_df( |
|||
~data.frame( |
|||
vers = rvest::html_nodes(.x, xpath = ".//td[2]") %>% rvest::html_text(trim=TRUE), |
|||
rls_date = rvest::html_nodes(.x, xpath = ".//td[3]") %>% rvest::html_text(trim=TRUE), |
|||
stringsAsFactors = FALSE |
|||
) |
|||
) %>% |
|||
mutate( |
|||
vers = stringi::stri_replace_last_fixed(vers, "/", ""), |
|||
rls_date = as.Date(substr(rls_date, 1, 10)) |
|||
) %>% |
|||
arrange(rls_date) %>% |
|||
mutate(vers = factor(vers)) %>% |
|||
mutate(rls_year = lubridate::year(rls_date)) -> bind_versions |
|||
|
|||
class(bind_versions) <- c("tbl_df", "tbl", "data.frame") |
|||
|
|||
bind_versions |
|||
|
|||
} |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/bind.R |
|||
\name{isc_bind_version_history} |
|||
\alias{isc_bind_version_history} |
|||
\title{Retrieve ISC BIND Version Release History} |
|||
\usage{ |
|||
isc_bind_version_history() |
|||
} |
|||
\description{ |
|||
Reads \url{https://ftp.isc.org/isc/bind9/} to build a data frame of |
|||
ISC BIND version release numbers and dates. NOTE that BIND version strings |
|||
are ugly (despite their commitment to semantic versioning) so this function |
|||
returns the BIND version (\code{vers}), the release date (\code{rls_date}) and release year |
|||
(\code{rls_year}) arranged in order from lowest version to latest version and |
|||
the \code{vers} column is an ordered factor. |
|||
} |
Loading…
Reference in new issue