Description Usage Arguments Details Value Examples
This is a pure R function that streams in WARC records and calls a callback function with the WARC headers and payload for each record, optionally filtering by a subset of WARC record types.
1 | warc_stream_in(path, handler, ..., warc_types = NULL)
|
path |
path to WARC file |
handler |
callback function to call for each record |
... |
optional arguments to |
warc_types |
if provided, only WARC record types matching the ones specified will
be streamed in and passed to |
The signature of the callback function should be:
function(headers, payload, ...)
the number of records processed (invisibly)
1 2 3 4 5 6 7 8 | myfun <- function(headers, payload, ...) {
print(as.numeric(headers$`content-length`) == length(payload))
}
warc_stream_in(
system.file("extdata/sample.warc.gz", package="jwatr"),
myfun
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.