mirror of https://git.sr.ht/~hrbrmstr/vershist
boB Rudis
4 years ago
8 changed files with 115 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||
#' Citrix Netscaler ADC Version History |
|||
#' |
|||
#' Reads <https://support.citrix.com/article/CTX121840> to build a data frame of |
|||
#' Citrix Netscaler ADC version release numbers and dates with semantic version |
|||
#' strings parsed and separate fields added. The data frame is also arranged in |
|||
#' order from lowest version to latest version and the `vers` column is an |
|||
#' ordered factor. |
|||
#' |
|||
#' @md |
|||
#' @export |
|||
citrix_netscaler_version_history <- function() { |
|||
|
|||
pg <- xml2::read_html("https://support.citrix.com/article/CTX121840") |
|||
|
|||
v <- rvest::html_nodes(pg, xpath = ".//h3[contains(., 'NetScaler Software Release')]") |
|||
|
|||
purrr::map_df(v, ~{ |
|||
cols <- ifelse(grepl("11.1", html_text(.x)), 2, 1) |
|||
tibble::tibble( |
|||
bld = rvest::html_nodes(.x, xpath = sprintf(".//following-sibling::table[1]//td[%s]", cols)) %>% rvest::html_text(trim = TRUE), |
|||
rls_date = rvest::html_nodes(.x, xpath = sprintf(".//following-sibling::table[1]//td[%s]", cols+1)) %>% rvest::html_text(trim = TRUE) |
|||
) %>% |
|||
mutate(bld = gsub("[[:space:]]*\\(.*$", "", bld)) %>% |
|||
mutate(mm = gsub("NetScaler Software Release ", "", html_text(.x))) |
|||
}) %>% |
|||
dplyr::select(mm, bld, rls_date) %>% |
|||
dplyr::filter(!grepl("^10", mm)) %>% |
|||
dplyr::filter(!grepl("Build", bld)) %>% |
|||
tidyr::separate_rows(bld, sep = "/") %>% |
|||
dplyr::mutate(bld = gsub("[[:space:]]*[[:alpha:]].*$", "", trimws(bld))) %>% |
|||
tidyr::separate(mm, c("maj", "min"), sep="\\.") %>% |
|||
tidyr::separate(bld, c("pat", "bld"), sep="\\.", fill = "right") %>% |
|||
dplyr::mutate(bld = ifelse(is.na(bld), "0", bld)) %>% |
|||
dplyr::mutate(vers = sprintf("%s.%s.%s.%s", maj, min, pat, bld)) %>% |
|||
dplyr::mutate(rls_date = lubridate::mdy(rls_date)) %>% |
|||
dplyr::mutate(rls_year = lubridate::year(rls_date)) %>% |
|||
dplyr::select(vers, rls_date, rls_year, maj, min, pat, bld) %>% |
|||
dplyr::distinct() %>% |
|||
dplyr::arrange(rls_date) %>% |
|||
dplyr::mutate(vers = forcats::fct_inorder(vers, ordered = TRUE)) |
|||
|
|||
} |
|||
|
@ -0,0 +1,37 @@ |
|||
#' Retrieve Virtualbox Version Release History |
|||
#' |
|||
#' Reads <https://download.virtualbox.org/virtualbox/> to build a data frame of |
|||
#' Virtualbox version release numbers and dates with semantic version |
|||
#' strings parsed and separate fields added. The data frame is also arranged in |
|||
#' order from lowest version to latest version and the `vers` column is an |
|||
#' ordered factor. |
|||
#' |
|||
#' @md |
|||
#' @export |
|||
virtualbox_version_history <- function() { |
|||
|
|||
pg <- xml2::read_html("https://download.virtualbox.org/virtualbox/") |
|||
|
|||
rvest::html_node(pg, "pre") %>% |
|||
rvest::html_text() %>% |
|||
stri_split_lines() %>% |
|||
unlist() %>% |
|||
stri_trim_both() %>% |
|||
keep(stri_detect_regex, "^[[:digit:]]") %>% |
|||
discard(stri_detect_fixed, "_") %>% |
|||
stri_match_first_regex("^([^/]+)/[[:space:]]+([[:digit:]]{2}-[[:alpha:]]{3}-[[:digit:]]{4})") %>% |
|||
.[,2:3] %>% |
|||
as.data.frame(stringsAsFactors=FALSE) %>% |
|||
dplyr::as_tibble() %>% |
|||
dplyr::select(vers = V1, rls_date = V2) %>% |
|||
tidyr::separate(vers, into = c("major", "minor", "patch"), sep = "\\.", remove = FALSE) %>% |
|||
dplyr::mutate( |
|||
rls_date = lubridate::dmy(rls_date), |
|||
rls_year = lubridate::year(rls_date) |
|||
) %>% |
|||
dplyr::select(vers, rls_date, rls_year, major, minor, patch) %>% |
|||
dplyr::arrange(as.integer(major), as.integer(minor), as.integer(patch)) %>% |
|||
dplyr::mutate(vers = factor(vers, levels = vers)) |
|||
|
|||
} |
|||
|
@ -0,0 +1,15 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/citrix-netscaler.R |
|||
\name{citrix_netscaler_version_history} |
|||
\alias{citrix_netscaler_version_history} |
|||
\title{Citrix Netscaler ADC Version History} |
|||
\usage{ |
|||
citrix_netscaler_version_history() |
|||
} |
|||
\description{ |
|||
Reads \url{https://support.citrix.com/article/CTX121840} to build a data frame of |
|||
Citrix Netscaler ADC version release numbers and dates with semantic version |
|||
strings parsed and separate fields added. The data frame is also arranged in |
|||
order from lowest version to latest version and the \code{vers} column is an |
|||
ordered factor. |
|||
} |
@ -0,0 +1,15 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/virtualbox.R |
|||
\name{virtualbox_version_history} |
|||
\alias{virtualbox_version_history} |
|||
\title{Retrieve Virtualbox Version Release History} |
|||
\usage{ |
|||
virtualbox_version_history() |
|||
} |
|||
\description{ |
|||
Reads \url{https://download.virtualbox.org/virtualbox/} to build a data frame of |
|||
Virtualbox version release numbers and dates with semantic version |
|||
strings parsed and separate fields added. The data frame is also arranged in |
|||
order from lowest version to latest version and the \code{vers} column is an |
|||
ordered factor. |
|||
} |
Loading…
Reference in new issue