WebFetch::PerlStruct - accepts a Perl structure with pre-parsed news |
WebFetch::PerlStruct - accepts a Perl structure with pre-parsed news
In perl scripts:
use WebFetch::PerlStruct;
$obj = new WebFetch::PerlStruct (
|
Note: WebFetch::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::PerlStruct module to read the remote file and generate and HTML summary of the news.
After WebFetch::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 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 fields of each has entry must provide enough information to match field names in all the the output formats you're using. Output formats include the following:
WebFetch::PerlStruct uses a format string identical to WebFetch::General. The default format for retrieved data is
<a href=``%url%''>%title%</a>
See the WebFetch::General documentation for more details.
The names of the fields are chosen by the calling function. Though for the convenience of the user, the author of an exporting module should keep in mind the default WebFetch::PerlStruct format uses fields called ``url'' and ``title''. If you use fields by different names, make sure your code provides those fields in the $content_struct parameter.
WebFetch was written by Ian Kluft
for the Silicon Valley Linux User Group (SVLUG).
Send patches, bug reports, suggestions and questions to
maint@webfetch.org
.
WebFetch::PerlStruct - accepts a Perl structure with pre-parsed news |