Browse Source

Google Chrome

master
boB Rudis 6 years ago
parent
commit
f4fde54db9
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 2
      NAMESPACE
  2. 4
      NEWS.md
  3. 2
      R/apache-httpd.R
  4. 35
      R/chrome.R
  5. 2
      R/vershist-package.R
  6. 7
      README.Rmd
  7. 23
      README.md
  8. BIN
      README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.RData
  9. 0
      README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdb
  10. BIN
      README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdx
  11. 15
      man/google_chrome_version_history.Rd

2
NAMESPACE

@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand
export(apache_httpd_version_history)
export(google_chrome_version_history)
export(is_valid)
export(lighttpd_version_history)
export(memcached_version_history)
@ -17,6 +18,7 @@ importFrom(curl,curl)
importFrom(dplyr,arrange)
importFrom(dplyr,as_data_frame)
importFrom(dplyr,bind_cols)
importFrom(dplyr,distinct)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_at)

4
NEWS.md

@ -1,4 +1,4 @@
0.1.0
* Initial release
* Support for Apache httpd, lighttpd, memcached, mongodb, nginx, mysql, openresty,
openssh, sendmail and sqlite
* Support for Apache httpd, Google Chrome lighttpd, memcached, mongodb, nginx, mysql,
openresty, openssh, sendmail and sqlite

2
R/apache-httpd.R

@ -21,7 +21,7 @@ apache_httpd_version_history <- function() {
dplyr::mutate(rls_year = lubridate::year(rls_date)) %>%
dplyr::bind_cols(
semver::parse_version(.$vers) %>%
as_data_frame()
dplyr::as_data_frame()
) %>%
dplyr::arrange(major, minor, patch) %>%
dplyr::mutate(vers = factor(vers, levels = vers))

35
R/chrome.R

@ -0,0 +1,35 @@
#' Retrieve Google Chrome Version Release History
#'
#' Reads <https://en.wikipedia.org/wiki/Google_Chrome_version_history"> to build a data
#' frame of Google Chrome 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
google_chrome_version_history <- function() {
pg <- xml2::read_html("https://en.wikipedia.org/wiki/Google_Chrome_version_history")
dplyr::data_frame(
vers = rvest::html_nodes(pg, xpath=".//tr/td[1]") %>% rvest::html_text(),
rls_date = rvest::html_nodes(pg, xpath=".//tr/td[2]") %>%
rvest::html_text() %>%
stri_extract_first_regex("[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}")
) %>%
dplyr::filter(!is.na(rls_date)) %>%
dplyr::mutate(rls_date = as.Date(rls_date)) %>%
dplyr::mutate(rls_year = lubridate::year(rls_date)) %>%
dplyr::mutate(
vers = ifelse(stri_count_fixed(vers, ".") == 1, sprintf("%s.0", vers), vers)
) %>%
dplyr::distinct(vers, .keep_all=TRUE) %>%
dplyr::bind_cols(
semver::parse_version(.$vers) %>%
dplyr::as_data_frame()
) %>%
dplyr::arrange(major, minor, patch) %>%
dplyr::mutate(vers = factor(vers, levels = vers))
}

2
R/vershist-package.R

@ -10,7 +10,7 @@
#' @import semver
#' @importFrom purrr keep discard map map_df %>% safely set_names
#' @importFrom dplyr mutate rename select as_data_frame left_join bind_cols arrange
#' @importFrom dplyr rename progress_estimated mutate_at
#' @importFrom dplyr rename progress_estimated mutate_at distinct
#' @importFrom stringi stri_match_first_regex stri_detect_fixed stri_detect_regex
#' @importFrom stringi stri_replace_all_regex stri_replace_first_fixed stri_trans_tolower
#' @importFrom stringi stri_extract_first_regex stri_sub stri_replace_first_regex

7
README.Rmd

@ -18,6 +18,7 @@ The following functions are implemented:
Core:
- `apache_httpd_version_history`: Retrieve Apache httpd Version Release History
- `google_chrome_version_history`: Retrieve Google Chrome Version Release History
- `lighttpd_version_history`: Retrieve lighttpd Version Release History
- `memcached_version_history`: Retrieve memcached Version Release History
- `mongodb_version_history`: Retrieve MongoDB Version Release History
@ -57,6 +58,12 @@ Apache
apache_httpd_version_history()
```
Google Chrome
```{r chrome, cache=TRUE}
google_chrome_version_history()
```
lighttpd
```{r lighttpd, cache=TRUE}

23
README.md

@ -16,6 +16,8 @@ Core:
- `apache_httpd_version_history`: Retrieve Apache httpd Version
Release History
- `google_chrome_version_history`: Retrieve Google Chrome Version
Release History
- `lighttpd_version_history`: Retrieve lighttpd Version Release
History
- `memcached_version_history`: Retrieve memcached Version Release
@ -72,6 +74,27 @@ apache_httpd_version_history()
## 10 1.3.14 2000-10-10 2000 1 3 14 "" ""
## # ... with 19 more rows
Google Chrome
``` r
google_chrome_version_history()
```
## # A tibble: 71 x 8
## vers rls_date rls_year major minor patch prerelease build
## <fct> <date> <dbl> <int> <int> <int> <chr> <chr>
## 1 0.2.149 2008-09-02 2008. 0 2 149 "" ""
## 2 0.3.154 2008-10-29 2008. 0 3 154 "" ""
## 3 0.4.154 2008-11-24 2008. 0 4 154 "" ""
## 4 1.0.154 2008-12-11 2008. 1 0 154 "" ""
## 5 2.0.172 2009-05-24 2009. 2 0 172 "" ""
## 6 3.0.195 2009-10-12 2009. 3 0 195 "" ""
## 7 4.0.249 2010-01-25 2010. 4 0 249 "" ""
## 8 4.1.249 2010-03-17 2010. 4 1 249 "" ""
## 9 5.0.375 2010-05-21 2010. 5 0 375 "" ""
## 10 6.0.472 2010-09-02 2010. 6 0 472 "" ""
## # ... with 61 more rows
lighttpd
``` r

BIN
README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.RData

Binary file not shown.

0
README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdb

BIN
README_cache/gfm/chrome_684fdbca374fdb61c560f50083ae4aab.rdx

Binary file not shown.

15
man/google_chrome_version_history.Rd

@ -0,0 +1,15 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chrome.R
\name{google_chrome_version_history}
\alias{google_chrome_version_history}
\title{Retrieve Google Chrome Version Release History}
\usage{
google_chrome_version_history()
}
\description{
Reads \url{https://en.wikipedia.org/wiki/Google_Chrome_version_history"} to build a data
frame of Google Chrome 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…
Cancel
Save