View on
Ian Kluft > WebFetch > WebFetch::Input::PerlStruct



Annotate this POD


New  1
Open  0
View/Report Bugs


WebFetch::Input::PerlStruct - accepts a Perl structure with pre-parsed news


In perl scripts:

use WebFetch::Input::PerlStruct;

$obj = new WebFetch::Input::PerlStruct ( "content" = content_struct, "dir" => output_dir, "dest" => output_file, "dest_format" => output_format, # used to select WebFetch output module [ "group" => file_group_id, ] [ "mode" => file_mode_perms, ] [ "quiet" => 1 ]);>

Note: WebFetch::Input::PerlStruct is a Perl interface only. It does not support usage from the command-line.


This module accepts a perl structure with pre-parsed news and pushes it into the WebFetch infrastructure.

The webmaster of a remote site only needs to arrange for a cron job to update a WebFetch Export file, and let others know the URL to reach that file. (On the exporting site, it is most likely they'll use WebFetch::SiteNews to export their own news.) Then you can use the WebFetch::Input::PerlStruct module to read the remote file and generate and HTML summary of the news.

After WebFetch::Input::PerlStruct runs, the file specified in the --file parameter will be created or replaced. If there already was a file by that name, it will be moved to a filename with "O" (for old) prepended to the file name.

Most of the parameters listed are inherited from WebFetch. See the WebFetch module documentation for details.


The $content_struct parameter may be in either of two formats.

If $content_struct is a hash reference containing entries called "fields", "wk_names" and "records", then it is assumed to be already in the format of the "data" element of the WebFetch Embedding API.

Otherwise, it must be a reference to an array of hashes. Each of the hashes represents a separate news item, in the order they should be displayed.

The field names should be consistent through all records. WebFetch uses the field names from the first record and assumes the remainder are identical.

The names of the fields are chosen by the calling function. If an array called "wk_names" is provided then it used to map well-known field names of the WebFetch Embedding API to field names in this data. Otherwise, meaning can only be applied to field names if they already match WebFetch's well-known field names.


WebFetch was written by Ian Kluft Send patches, bug reports, suggestions and questions to


syntax highlighting: