Browse Source

some tweaks before dinner

boB Rudis 2 years ago
parent
commit
7965e8d624
No known key found for this signature in database
9 changed files with 39 additions and 49 deletions
  1. 1
    0
      .Rbuildignore
  2. 3
    1
      DESCRIPTION
  3. 1
    0
      NAMESPACE
  4. 0
    11
      README.Rmd
  5. 10
    35
      README.md
  6. BIN
      img/cap.png
  7. 1
    1
      man/get_response_body.Rd
  8. 19
    0
      man/json_fromb64.Rd
  9. 4
    1
      man/splashr.Rd

+ 1
- 0
.Rbuildignore View File

@@ -10,3 +10,4 @@
10 10
 ^README_files$
11 11
 ^appveyor\.yml$
12 12
 ^codecov\.yml$
13
+^docs$

+ 3
- 1
DESCRIPTION View File

@@ -4,7 +4,9 @@ Title: Tools to Work with the 'Splash' 'JavaScript' Rendering Service
4 4
 Version: 0.4.0
5 5
 Date: 2017-08-26
6 6
 Encoding: UTF-8
7
-Author: Bob Rudis (bob@rud.is)
7
+Authors@R: c(
8
+      person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"))
9
+    )
8 10
 Maintainer: Bob Rudis <bob@rud.is>
9 11
 Description: 'Splash' <https://github.com/scrapinghub/splash> is a 'JavaScript' rendering service.
10 12
     It’s a lightweight web browser with an 'HTTP' API, implemented in 'Python' using 'Twisted' 

+ 1
- 0
NAMESPACE View File

@@ -35,6 +35,7 @@ export(is_post)
35 35
 export(is_svg)
36 36
 export(is_xhr)
37 37
 export(is_xml)
38
+export(json_fromb64)
38 39
 export(killall_splash)
39 40
 export(renderHARviewer)
40 41
 export(render_har)

+ 0
- 11
README.Rmd View File

@@ -247,17 +247,6 @@ render_file(url = "/tmp/diag.html", output="html")
247 247
 stop_splash(splash_vm)
248 248
 ```
249 249
 
250
-### Test Results
251
-
252
-```{r message=FALSE, warning=FALSE, error=FALSE}
253
-library(splashr)
254
-library(testthat)
255
-
256
-date()
257
-
258
-test_dir("tests/")
259
-```
260
-
261 250
 ### Code of Conduct
262 251
 
263 252
 Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

+ 10
- 35
README.md View File

@@ -151,13 +151,13 @@ splash_debug()
151 151
     ## List of 7
152 152
     ##  $ active  : list()
153 153
     ##  $ argcache: int 0
154
-    ##  $ fds     : int 14
154
+    ##  $ fds     : int 21
155 155
     ##  $ leaks   :List of 4
156 156
     ##   ..$ Deferred  : int 50
157 157
     ##   ..$ LuaRuntime: int 1
158 158
     ##   ..$ QTimer    : int 1
159 159
     ##   ..$ Request   : int 1
160
-    ##  $ maxrss  : int 76308
160
+    ##  $ maxrss  : int 228260
161 161
     ##  $ qsize   : int 0
162 162
     ##  $ url     : chr "http://localhost:8050"
163 163
     ##  - attr(*, "class")= chr [1:2] "splash_debug" "list"
@@ -171,7 +171,7 @@ render_html(url = "http://marvel.com/universe/Captain_America_(Steve_Rogers)")
171 171
 
172 172
     ## {xml_document}
173 173
     ## <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
174
-    ## [1] <head>\n<script type="text/javascript" async="async" src="http://dpm.demdex.net/id?d_rtbd=json&amp;d_ver=2&amp;d_ ...
174
+    ## [1] <head>\n<script type="text/javascript" async="" charset="utf-8" src="http://ds.serving-sys.com/SemiCachedScripts/ ...
175 175
     ## [2] <body id="index-index" class="index-index" onload="findLinks('myLink');">\n\n\t<div id="page_frame" style="overfl ...
176 176
 
177 177
 ``` r
@@ -202,21 +202,16 @@ print(har)
202 202
     ## --------HAR PAGES-------- 
203 203
     ## Page id: 1 , Page title: Poynter – A global leader in journalism. Strengthening democracy. 
204 204
     ## --------HAR ENTRIES-------- 
205
-    ## Number of entries: 42 
205
+    ## Number of entries: 6 
206 206
     ## REQUESTS: 
207 207
     ## Page: 1 
208
-    ## Number of entries: 42 
208
+    ## Number of entries: 6 
209 209
     ##   -  http://www.poynter.org/ 
210
-    ##   -  http://www.poynter.org/wp-content/plugins/easy-author-image/css/easy-author-image.css?ver=2016_06_24.1 
211
-    ##   -  http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css?ver=2016_06_24.1 
212
-    ##   -  http://cloud.webtype.com/css/162ac332-3b31-4b73-ad44-da375b7f2fe3.css?ver=2016_06_24.1 
213
-    ##   -  http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css?ver=2016_06_24.1 
214
-    ##      ........ 
215
-    ##   -  http://cloud.webtype.com/webtype/ff2/3/4ac7f809-9bdf-4acc-8bd5-a922f05f271b?ec_token=8f7c4c4997246fd7fa920171c994... 
216
-    ##   -  http://cloud.webtype.com/webtype/ff2/3/c6608520-1978-45ac-9061-74ada664cae4?ec_token=8f7c4c4997246fd7fa920171c994... 
217
-    ##   -  http://cloud.webtype.com/webtype/ff2/3/380e3672-840d-462a-83ee-2ea85a43504a?ec_token=8f7c4c4997246fd7fa920171c994... 
218
-    ##   -  http://cloud.webtype.com/webtype/ff2/3/c6369fc5-fc59-4a12-ac92-25afa6c567a0?ec_token=8f7c4c4997246fd7fa920171c994... 
219
-    ##   -  http://static.chartbeat.com/js/chartbeat.js
210
+    ##   -  http://www.googletagservices.com/tag/js/gpt.js 
211
+    ##   -  http://s.ntv.io/serve/load.js?ver=4.6.1 
212
+    ##   -  http://www.googletagservices.com/tag/js/gpt.js 
213
+    ##   -  http://www.google-analytics.com/analytics.js 
214
+    ##   -  http://static.parsely.com/p.js
220 215
 
221 216
 You can use [`HARtools::HARviewer`](https://github.com/johndharrison/HARtools/blob/master/R/HARviewer.R) — which this pkg import/exports — to get view the HAR in an interactive HTML widget.
222 217
 
@@ -275,26 +270,6 @@ splash_local %>%
275 270
 stop_splash(splash_vm)
276 271
 ```
277 272
 
278
-### Test Results
279
-
280
-``` r
281
-library(splashr)
282
-library(testthat)
283
-
284
-date()
285
-```
286
-
287
-    ## [1] "Sun Aug 27 09:01:57 2017"
288
-
289
-``` r
290
-test_dir("tests/")
291
-```
292
-
293
-    ## testthat results ========================================================================================================
294
-    ## OK: 8 SKIPPED: 0 FAILED: 0
295
-    ## 
296
-    ## DONE ===================================================================================================================
297
-
298 273
 ### Code of Conduct
299 274
 
300 275
 Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

BIN
img/cap.png View File


+ 1
- 1
man/get_response_body.Rd View File

@@ -4,7 +4,7 @@
4 4
 \alias{get_response_body}
5 5
 \title{Retrieve the body content of a HAR entry}
6 6
 \usage{
7
-get_response_body(har_resp_obj)
7
+get_response_body(har_resp_obj, type = c("raw", "text"))
8 8
 }
9 9
 \arguments{
10 10
 \item{har_resp_obj}{HAR response object}

+ 19
- 0
man/json_fromb64.Rd View File

@@ -0,0 +1,19 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/utils.r
3
+\name{json_fromb64}
4
+\alias{json_fromb64}
5
+\title{Convert a Base64 encoded string into an R object}
6
+\usage{
7
+json_fromb64(x, flatten = TRUE, ...)
8
+}
9
+\arguments{
10
+\item{x}{a string}
11
+
12
+\item{flatten}{flatten JSON structures upon conversion?}
13
+
14
+\item{...}{passed on to \code{jsonlite::fromJSON()}}
15
+}
16
+\description{
17
+A simple wrapper around calls to \code{openssl::base64_decode()} and
18
+\code{jsonlite::fromJSON()}.
19
+}

+ 4
- 1
man/splashr.Rd View File

@@ -9,7 +9,10 @@
9 9
 'Splash' \url{https://github.com/scrapinghub/splash} is a 'JavaScript' rendering service.
10 10
 It’s a lightweight web browser with an 'HTTP' API, implemented in 'Python' using 'Twisted'
11 11
 and 'QT' and provides some of the core functionality of the 'RSelenium' or 'seleniumPipes'
12
-R pacakges in a lightweight footprint. Some of 'Splash' features include the ability to process
12
+R pacakges in a lightweight footprint.
13
+}
14
+\details{
15
+Some of 'Splash' features include the ability to process
13 16
 multiple webpages in parallel; retrieving 'HTML' results and/or take screenshots; disabling
14 17
 images or use 'Adblock Plus' rules to make rendering faster; executing custom 'JavaScript' in
15 18
 page context; getting detailed rendering info in 'HAR' format.

Loading…
Cancel
Save