Browse Source

CRAN test

boB Rudis 1 year ago
parent
commit
713450e229
No known key found for this signature in database

+ 1
- 1
DESCRIPTION View File

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

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

@@ -9,7 +9,7 @@
9 9
 #' splash_container <- start_splash()
10 10
 #' stop_splash(splash_container)
11 11
 #' }
12
-install_splash <- function(tag="3.2") {
12
+install_splash <- function(tag="latest") {
13 13
   docker <- stevedore::docker_client()
14 14
   res <- docker$image$pull("scrapinghub/splash", tag=tag, stream=stdout())
15 15
 }
@@ -19,6 +19,10 @@ install_splash <- function(tag="3.2") {
19 19
 #' If using this in an automation context, you should consider adding a
20 20
 #' `Sys.sleep(3)` (or higher) after starting the docker container.
21 21
 #'
22
+#' This uses the `latest` image and passed the `--disable-browser-caches`
23
+#' parameter. If you do not want to use the 3.2.x+ versions of `Splash`
24
+#' you should use your own startup scripts vs this helper function.
25
+#'
22 26
 #' @param tag Splash Docker image tag to start
23 27
 #' @note you need Docker running on your system and have pulled the container with
24 28
 #'       [install_splash] for this to work. You should save the resultant
@@ -27,6 +31,7 @@ install_splash <- function(tag="3.2") {
27 31
 #' @param container_name naem for the container. Defaults to "`splashr`".
28 32
 #' @param remove remove the Splash container instance after it's stopped?
29 33
 #'        Defaults to `FALSE`.
34
+#' @param ... passed on to Splash instance launch parameters
30 35
 #' @family splash_docker_helpers
31 36
 #' @return `stevedor` container object
32 37
 #' @export
@@ -35,7 +40,7 @@ install_splash <- function(tag="3.2") {
35 40
 #' splash_container <- start_splash()
36 41
 #' stop_splash(splash_container)
37 42
 #' }
38
-start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
43
+start_splash <- function(tag="latest", container_name = "splashr", remove=FALSE, ...) {
39 44
 
40 45
   docker <- stevedore::docker_client()
41 46
 
@@ -45,7 +50,9 @@ start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
45 50
     ports = c("5023:5023", "8051:8051", "8050:8050"),
46 51
     detach = TRUE,
47 52
     rm = remove,
48
-    tty = TRUE
53
+    tty = TRUE,
54
+    "--disable-browser-caches",
55
+    ...
49 56
   ) -> splash_inst
50 57
 
51 58
   invisible(splash_inst)

+ 1
- 1
man/as_har.Rd View File

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

+ 1
- 1
man/as_httr_req.Rd View File

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

+ 1
- 1
man/as_response.Rd View File

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

+ 1
- 1
man/execute_lua.Rd View File

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

+ 1
- 1
man/get_content_size.Rd View File

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

+ 1
- 1
man/get_content_type.Rd View File

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

+ 1
- 1
man/get_har_entry.Rd View File

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

+ 1
- 1
man/get_request_type.Rd View File

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

+ 1
- 1
man/get_request_url.Rd View File

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

+ 1
- 1
man/get_response_body.Rd View File

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

+ 1
- 1
man/har_entries.Rd View File

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

+ 1
- 1
man/har_entry_count.Rd View File

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

+ 2
- 2
man/install_splash.Rd View File

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

+ 1
- 1
man/json_fromb64.Rd View File

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

+ 1
- 1
man/killall_splash.Rd View File

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

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

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

+ 1
- 1
man/render_har.Rd View File

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

+ 1
- 1
man/render_html.Rd View File

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

+ 1
- 1
man/render_jpeg.Rd View File

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

+ 1
- 1
man/render_json.Rd View File

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

+ 1
- 1
man/render_png.Rd View File

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

+ 1
- 1
man/splash.Rd View File

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

+ 1
- 1
man/splash_active.Rd View File

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

+ 1
- 1
man/splash_add_lua.Rd View File

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

+ 1
- 1
man/splash_click.Rd View File

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

+ 1
- 1
man/splash_debug.Rd View File

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

+ 1
- 1
man/splash_enable_javascript.Rd View File

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

+ 1
- 1
man/splash_focus.Rd View File

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

+ 1
- 1
man/splash_go.Rd View File

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

+ 1
- 1
man/splash_har.Rd View File

@@ -1,5 +1,5 @@
1 1
 % Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/dsl.R
2
+% Please edit documentation in R/dsl.r
3 3
 \name{splash_har}
4 4
 \alias{splash_har}
5 5
 \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 @@
1 1
 % Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/dsl.R
2
+% Please edit documentation in R/dsl.r
3 3
 \name{splash_har_reset}
4 4
 \alias{splash_har_reset}
5 5
 \title{Drops all internally stored HAR records.}

+ 1
- 1
man/splash_history.Rd View File

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

+ 1
- 1
man/splash_html.Rd View File

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

+ 1
- 1
man/splash_images.Rd View File

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

+ 1
- 1
man/splash_perf_stats.Rd View File

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

+ 1
- 1
man/splash_plugins.Rd View File

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

+ 1
- 1
man/splash_png.Rd View File

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

+ 1
- 1
man/splash_press.Rd View File

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

+ 1
- 1
man/splash_private_mode.Rd View File

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

+ 1
- 1
man/splash_release.Rd View File

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

+ 1
- 1
man/splash_response_body.Rd View File

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

+ 1
- 1
man/splash_send_keys.Rd View File

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

+ 1
- 1
man/splash_send_text.Rd View File

@@ -1,5 +1,5 @@
1 1
 % Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/dsl.R
2
+% Please edit documentation in R/dsl.r
3 3
 \name{splash_send_text}
4 4
 \alias{splash_send_text}
5 5
 \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 @@
1 1
 % Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/dsl.R, R/user-agents.R
2
+% Please edit documentation in R/dsl.r, R/user-agents.R
3 3
 \docType{data}
4 4
 \name{splash_user_agent}
5 5
 \alias{splash_user_agent}

+ 1
- 1
man/splash_version.Rd View File

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

+ 1
- 1
man/splash_wait.Rd View File

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

+ 10
- 2
man/start_splash.Rd View File

@@ -1,10 +1,11 @@
1 1
 % Generated by roxygen2: do not edit by hand
2
-% Please edit documentation in R/docker-splash.R
2
+% Please edit documentation in R/docker-splash.r
3 3
 \name{start_splash}
4 4
 \alias{start_splash}
5 5
 \title{Start a Splash server Docker container}
6 6
 \usage{
7
-start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)
7
+start_splash(tag = "latest", container_name = "splashr",
8
+  remove = FALSE, ...)
8 9
 }
9 10
 \arguments{
10 11
 \item{tag}{Splash Docker image tag to start}
@@ -13,6 +14,8 @@ start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)
13 14
 
14 15
 \item{remove}{remove the Splash container instance after it's stopped?
15 16
 Defaults to `FALSE`.}
17
+
18
+\item{...}{passed on to Splash instance launch parameters}
16 19
 }
17 20
 \value{
18 21
 `stevedor` container object
@@ -21,6 +24,11 @@ Defaults to `FALSE`.}
21 24
 If using this in an automation context, you should consider adding a
22 25
 `Sys.sleep(3)` (or higher) after starting the docker container.
23 26
 }
27
+\details{
28
+This uses the `latest` image and passed the `--disable-browser-caches`
29
+parameter. If you do not want to use the 3.2.x+ versions of `Splash`
30
+you should use your own startup scripts vs this helper function.
31
+}
24 32
 \note{
25 33
 you need Docker running on your system and have pulled the container with
26 34
       [install_splash] for this to work. You should save the resultant

+ 1
- 1
man/stop_splash.Rd View File

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

Loading…
Cancel
Save