NAME
WebFetch::Output::Capture - capture WebFetch data without generating an output file
VERSION
version 0.15.5
SYNOPSIS
In perl scripts:
use WebFetch::RSS; # or another WebFetch input - this example shows RSS
use WebFetch::Output::Capture;
# ... fill in $params hashref
my %Options = (
dir => $params->{temp_dir},
source_format => "rss",
source => "file://".$input_dir."/".$params->{in},
dest_format => "capture",
dest => "", # unused
);
WebFetch::RSS->run(\%Options);
my @data_records = WebFetch::Output::Capture::data_records();
DESCRIPTION
This is a WebFetch output module which captures WebFetch output as a data structure rather than formatting it and saving it in a file. The data can be collected from any WebFetch input module.
This module is used for testing WebFetch.
FUNCTIONS
- $obj->set_grep_func( $func_ref )
-
This function receives a CODE reference and saves it for use in a grep of the WebFetch data records. It is optional. If not set, the data_records() method will return all the data retreived by WebFetch.
- $obj->fmt_handler_capture()
-
This function is called by WebFetch when the capture destination is selected. It saves the output in a structure. There is no output to any file when using this format.
- WebFetch::Output::Capture::data_records()
-
returns a list of the data records retrived by WebFetch. The structure of each data record varies depending what input format was selected when WebFetch was run. Usually another output module should be used to output this data to a file in a specific data format. When using the capture method, you receive the raw data records.
SEE ALSO
WebFetch https://github.com/ikluft/WebFetch
BUGS AND LIMITATIONS
Please report bugs via GitHub at https://github.com/ikluft/WebFetch/issues
Patches and enhancements may be submitted via a pull request at https://github.com/ikluft/WebFetch/pulls
AUTHOR
Ian Kluft <https://github.com/ikluft>
COPYRIGHT AND LICENSE
This software is Copyright (c) 1998-2022 by Ian Kluft.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007