Description Usage Arguments Value Examples
View source: R/collect_screenshots_from_s3.R
Download screenshots previously stored on S3 through ScrapeBot instances. The function will collect those cases in the data that refer to S3-stored screenshots and download them to a local output directory. While doing so, the funtion can also resize images to save local disk space.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
scrapebot_connection |
A connection object, as retrieved from |
aws_connection |
AWS connection object, as retrieved from |
run_uid |
Optional numeric UID or a vector of numeric UIDs of a specific run to collect data from. If |
instance_uid |
Optional numeric UID or a vector of numeric UIDs of the instance to filter data for. If |
recipe_uid |
Optional numeric UID or a vector of numeric UIDs of the recipe to filter data for. If |
include_inactive |
If |
resize |
If |
resize_max_width |
Integer indicating the maximum width images should be resized to (if |
resize_max_height |
Integer indicating the maximum height images should be resized to (if |
output_directory |
Character string holding the (relative) path to the directory into which the screenshot files should be downloaded. |
verbose |
If |
A tibble listing all matching run-data entries according to which screenshots should be found on S3. As such, it contains the same amount of rows as received from get_run_data
when filtering for the respective parameters and S3 links for "screenshot"-containing recipe steps (i.e., get_recipes
first, then get_recipe_steps
and filter for "screenshot," then get_run_data
and filter for S3 links). For each row, then, the local filename, width, height, and filesize (in bytes) as well as their respective counterparts on S3 (note that, without resizing, width/height/filesize should be practically the same).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
connection <- connect('my_db on localhost')
collect_screenshots_from_s3(
scrapebot_connection, aws_connection,
run_uid = 42
)
collect_screenshots_from_s3(
scrapebot_connection, aws_connection,
run_uid = 42,
resize = TRUE, resize_max_width = 800
)
collect_screenshots_from_s3(
scrapebot_connection, aws_connection,
run_uid = 42,
output_directory = 'download_dir/'
)
disconnect(connection)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.