Shrip is life.
devtools::install_github('chebuu/shrip')
help("shrip")
library(shrip)
library(xml2)
# Define:
PAGE_BASE <- NULL # Base url to iterate
FILE_BASE <- NULL # Base url to iterate
XPATH_PAGES <- list( # XPath queries
'//div[2]/header[1]/em' = xml2::xml_find_all
)
XPATH_FILES <- list( # XPath queries
'//div[1]/div[1]/strong[1]/a' = xml2::xml_find_first,
'//div[1]/div[2]/strong[1]/a[1]' = xml2::xml_find_first,
'//div[1]/div[2]/strong[1]/a[2]' = xml2::xml_find_first
)
myIter <- function(res, xpath) lapply(
names(xpath),
function(xp) {
xml2::xml_txt(
XPATH_PAGES[[xp]]
(content(res, 'parsed'), xp)
)
}
)
cbPages <- function(res) {
unlist(
myIter(res, XPATH_PAGES)
)
}
cbFiles <- function(res) {
unlist(
myIter(res, XPATH_PAGES)
)
}
# Run:
shrip::rip(1:10, cbPages, cbFiles)
You don't have this.
# source("<theconfigfile>.R")
help('Shrip Help','shrip')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.