Browse Source

CRAN test

0.6.0
boB Rudis 1 year ago
parent
commit
713450e229
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
50 changed files with 69 additions and 54 deletions
  1. +1
    -1
      DESCRIPTION
  2. +10
    -3
      R/docker-splash.r
  3. +1
    -1
      man/as_har.Rd
  4. +1
    -1
      man/as_httr_req.Rd
  5. +1
    -1
      man/as_response.Rd
  6. +1
    -1
      man/execute_lua.Rd
  7. +1
    -1
      man/get_content_size.Rd
  8. +1
    -1
      man/get_content_type.Rd
  9. +1
    -1
      man/get_har_entry.Rd
  10. +1
    -1
      man/get_request_type.Rd
  11. +1
    -1
      man/get_request_url.Rd
  12. +1
    -1
      man/get_response_body.Rd
  13. +1
    -1
      man/har_entries.Rd
  14. +1
    -1
      man/har_entry_count.Rd
  15. +2
    -2
      man/install_splash.Rd
  16. +1
    -1
      man/json_fromb64.Rd
  17. +1
    -1
      man/killall_splash.Rd
  18. +1
    -1
      man/print.splashr.Rd
  19. +1
    -1
      man/render_har.Rd
  20. +1
    -1
      man/render_html.Rd
  21. +1
    -1
      man/render_jpeg.Rd
  22. +1
    -1
      man/render_json.Rd
  23. +1
    -1
      man/render_png.Rd
  24. +1
    -1
      man/splash.Rd
  25. +1
    -1
      man/splash_active.Rd
  26. +1
    -1
      man/splash_add_lua.Rd
  27. +1
    -1
      man/splash_click.Rd
  28. +1
    -1
      man/splash_debug.Rd
  29. +1
    -1
      man/splash_enable_javascript.Rd
  30. +1
    -1
      man/splash_focus.Rd
  31. +1
    -1
      man/splash_go.Rd
  32. +1
    -1
      man/splash_har.Rd
  33. +1
    -1
      man/splash_har_reset.Rd
  34. +1
    -1
      man/splash_history.Rd
  35. +1
    -1
      man/splash_html.Rd
  36. +1
    -1
      man/splash_images.Rd
  37. +1
    -1
      man/splash_perf_stats.Rd
  38. +1
    -1
      man/splash_plugins.Rd
  39. +1
    -1
      man/splash_png.Rd
  40. +1
    -1
      man/splash_press.Rd
  41. +1
    -1
      man/splash_private_mode.Rd
  42. +1
    -1
      man/splash_release.Rd
  43. +1
    -1
      man/splash_response_body.Rd
  44. +1
    -1
      man/splash_send_keys.Rd
  45. +1
    -1
      man/splash_send_text.Rd
  46. +1
    -1
      man/splash_user_agent.Rd
  47. +1
    -1
      man/splash_version.Rd
  48. +1
    -1
      man/splash_wait.Rd
  49. +10
    -2
      man/start_splash.Rd
  50. +1
    -1
      man/stop_splash.Rd

+ 1
- 1
DESCRIPTION View File

@@ -2,7 +2,7 @@ Package: splashr
Type: Package
Title: Tools to Work with the 'Splash' 'JavaScript' Rendering and Scraping Service
Version: 0.6.0
Date: 2019-01-13
Date: 2019-02-24
Encoding: UTF-8
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),


+ 10
- 3
R/docker-splash.r View File

@@ -9,7 +9,7 @@
#' splash_container <- start_splash()
#' stop_splash(splash_container)
#' }
install_splash <- function(tag="3.2") {
install_splash <- function(tag="latest") {
docker <- stevedore::docker_client()
res <- docker$image$pull("scrapinghub/splash", tag=tag, stream=stdout())
}
@@ -19,6 +19,10 @@ install_splash <- function(tag="3.2") {
#' If using this in an automation context, you should consider adding a
#' `Sys.sleep(3)` (or higher) after starting the docker container.
#'
#' This uses the `latest` image and passed the `--disable-browser-caches`
#' parameter. If you do not want to use the 3.2.x+ versions of `Splash`
#' you should use your own startup scripts vs this helper function.
#'
#' @param tag Splash Docker image tag to start
#' @note you need Docker running on your system and have pulled the container with
#' [install_splash] for this to work. You should save the resultant
@@ -27,6 +31,7 @@ install_splash <- function(tag="3.2") {
#' @param container_name naem for the container. Defaults to "`splashr`".
#' @param remove remove the Splash container instance after it's stopped?
#' Defaults to `FALSE`.
#' @param ... passed on to Splash instance launch parameters
#' @family splash_docker_helpers
#' @return `stevedor` container object
#' @export
@@ -35,7 +40,7 @@ install_splash <- function(tag="3.2") {
#' splash_container <- start_splash()
#' stop_splash(splash_container)
#' }
start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
start_splash <- function(tag="latest", container_name = "splashr", remove=FALSE, ...) {

docker <- stevedore::docker_client()

@@ -45,7 +50,9 @@ start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
ports = c("5023:5023", "8051:8051", "8050:8050"),
detach = TRUE,
rm = remove,
tty = TRUE
tty = TRUE,
"--disable-browser-caches",
...
) -> splash_inst

invisible(splash_inst)


+ 1
- 1
man/as_har.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-har.R
% Please edit documentation in R/render-har.r
\name{as_har}
\alias{as_har}
\title{Turn a generic Splash HAR response into a HAR object}


+ 1
- 1
man/as_httr_req.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_req.R
% Please edit documentation in R/as_req.r
\name{as_httr_req}
\alias{as_httr_req}
\title{Create an httr verb request function from an HAR request}


+ 1
- 1
man/as_response.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_request.R
% Please edit documentation in R/as_request.r
\name{as_response}
\alias{as_response}
\title{Return a HAR entry response as an httr::response object}


+ 1
- 1
man/execute_lua.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/execute.R
% Please edit documentation in R/execute.r
\name{execute_lua}
\alias{execute_lua}
\title{Execute a custom rendering script and return a result.}


+ 1
- 1
man/get_content_size.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/content.R
% Please edit documentation in R/content.r
\name{get_content_size}
\alias{get_content_size}
\alias{get_body_size}


+ 1
- 1
man/get_content_type.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_content_type}
\alias{get_content_type}
\alias{is_content_type}


+ 1
- 1
man/get_har_entry.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_har_entry}
\alias{get_har_entry}
\title{Retrieve an entry by index from a HAR object}


+ 1
- 1
man/get_request_type.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_request_type}
\alias{get_request_type}
\alias{is_get}


+ 1
- 1
man/get_request_url.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_request_url}
\alias{get_request_url}
\title{Retrieve request URL}


+ 1
- 1
man/get_response_body.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_response_body}
\alias{get_response_body}
\title{Retrieve the body content of a HAR entry}


+ 1
- 1
man/har_entries.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{har_entries}
\alias{har_entries}
\title{Retrieve just the HAR entries from a splashr request}


+ 1
- 1
man/har_entry_count.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{har_entry_count}
\alias{har_entry_count}
\title{Retrieves number of HAR entries in a response}


+ 2
- 2
man/install_splash.Rd View File

@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{install_splash}
\alias{install_splash}
\title{Retrieve the Docker image for Splash}
\usage{
install_splash(tag = "3.2")
install_splash(tag = "latest")
}
\arguments{
\item{tag}{Splash Docker image tag to install}


+ 1
- 1
man/json_fromb64.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
% Please edit documentation in R/utils.r
\name{json_fromb64}
\alias{json_fromb64}
\title{Convert a Base64 encoded string into an R object}


+ 1
- 1
man/killall_splash.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{killall_splash}
\alias{killall_splash}
\title{Prune all dead and running Splash Docker containers}


+ 1
- 1
man/print.splashr.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{print.splashr}
\alias{print.splashr}
\title{Print for splashr}


+ 1
- 1
man/render_har.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-har.R
% Please edit documentation in R/render-har.r
\name{render_har}
\alias{render_har}
\title{Return information about Splash interaction with a website in HAR format.}


+ 1
- 1
man/render_html.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-html.R
% Please edit documentation in R/render-html.r
\name{render_html}
\alias{render_html}
\title{Return the HTML of the javascript-rendered page.}


+ 1
- 1
man/render_jpeg.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-jpg.R
% Please edit documentation in R/render-jpg.r
\name{render_jpeg}
\alias{render_jpeg}
\title{Return a image (in JPEG format) of the javascript-rendered page.}


+ 1
- 1
man/render_json.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-json.R
% Please edit documentation in R/render-json.r
\name{render_json}
\alias{render_json}
\title{Return a json-encoded dictionary with information about javascript-rendered webpage.}


+ 1
- 1
man/render_png.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-png.R
% Please edit documentation in R/render-png.r
\name{render_png}
\alias{render_png}
\title{Return an image (in PNG format) of the javascript-rendered page.}


+ 1
- 1
man/splash.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\docType{data}
\name{splash}
\alias{splash}


+ 1
- 1
man/splash_active.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_active}
\alias{splash_active}
\title{Test if a Splash server is up}


+ 1
- 1
man/splash_add_lua.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_add_lua}
\alias{splash_add_lua}
\title{Add raw lua code into DSL call chain}


+ 1
- 1
man/splash_click.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_click}
\alias{splash_click}
\title{Trigger mouse click event in web page.}


+ 1
- 1
man/splash_debug.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_debug}
\alias{splash_debug}
\alias{print.splash_debug}


+ 1
- 1
man/splash_enable_javascript.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_enable_javascript}
\alias{splash_enable_javascript}
\title{Enable or disable execution of JavaSript code embedded in the page.}


+ 1
- 1
man/splash_focus.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_focus}
\alias{splash_focus}
\title{Focus on a document element provided by a CSS selector}


+ 1
- 1
man/splash_go.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_go}
\alias{splash_go}
\title{Go to an URL.}


+ 1
- 1
man/splash_har.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_har}
\alias{splash_har}
\title{Return information about Splash interaction with a website in HAR format.}


+ 1
- 1
man/splash_har_reset.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_har_reset}
\alias{splash_har_reset}
\title{Drops all internally stored HAR records.}


+ 1
- 1
man/splash_history.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_history}
\alias{splash_history}
\title{Get information about requests/responses for the pages loaded}


+ 1
- 1
man/splash_html.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_html}
\alias{splash_html}
\title{Return a HTML snapshot of a current page.}


+ 1
- 1
man/splash_images.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_images}
\alias{splash_images}
\title{Enable/disable images}


+ 1
- 1
man/splash_perf_stats.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_perf_stats}
\alias{splash_perf_stats}
\title{Get Splash performance-related statistics}


+ 1
- 1
man/splash_plugins.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_plugins}
\alias{splash_plugins}
\title{Enable or disable browser plugins (e.g. Flash).}


+ 1
- 1
man/splash_png.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_png}
\alias{splash_png}
\title{Return a screenshot of a current page in PNG format.}


+ 1
- 1
man/splash_press.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_press}
\alias{splash_press}
\title{Trigger mouse press event in web page.}


+ 1
- 1
man/splash_private_mode.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_private_mode}
\alias{splash_private_mode}
\title{Enable or disable execution of JavaSript code embedded in the page.}


+ 1
- 1
man/splash_release.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_release}
\alias{splash_release}
\title{Trigger mouse release event in web page.}


+ 1
- 1
man/splash_response_body.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_response_body}
\alias{splash_response_body}
\title{Enable or disable response content tracking.}


+ 1
- 1
man/splash_send_keys.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_send_keys}
\alias{splash_send_keys}
\title{Send keyboard events to page context.}


+ 1
- 1
man/splash_send_text.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_send_text}
\alias{splash_send_text}
\title{Send text as input to page context, literally, character by character.}


+ 1
- 1
man/splash_user_agent.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R, R/user-agents.R
% Please edit documentation in R/dsl.r, R/user-agents.R
\docType{data}
\name{splash_user_agent}
\alias{splash_user_agent}


+ 1
- 1
man/splash_version.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_version}
\alias{splash_version}
\title{Get Splash version information}


+ 1
- 1
man/splash_wait.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_wait}
\alias{splash_wait}
\title{Wait for a period time}


+ 10
- 2
man/start_splash.Rd View File

@@ -1,10 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{start_splash}
\alias{start_splash}
\title{Start a Splash server Docker container}
\usage{
start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)
start_splash(tag = "latest", container_name = "splashr",
remove = FALSE, ...)
}
\arguments{
\item{tag}{Splash Docker image tag to start}
@@ -13,6 +14,8 @@ start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)

\item{remove}{remove the Splash container instance after it's stopped?
Defaults to `FALSE`.}

\item{...}{passed on to Splash instance launch parameters}
}
\value{
`stevedor` container object
@@ -21,6 +24,11 @@ Defaults to `FALSE`.}
If using this in an automation context, you should consider adding a
`Sys.sleep(3)` (or higher) after starting the docker container.
}
\details{
This uses the `latest` image and passed the `--disable-browser-caches`
parameter. If you do not want to use the 3.2.x+ versions of `Splash`
you should use your own startup scripts vs this helper function.
}
\note{
you need Docker running on your system and have pulled the container with
[install_splash] for this to work. You should save the resultant


+ 1
- 1
man/stop_splash.Rd View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{stop_splash}
\alias{stop_splash}
\title{Stop a running a Splash server Docker container}


Loading…
Cancel
Save