 |
I wrote a few functions to parse backend news files. They are 3 functions
based on the type of backend:
- RDF files are used by My Netscape channels. The news is described using
XML syntax.
function parserdf($hostname, $uri, $port = 80, $maxitems = 0);
- $hostname, the address of the host.
- $uri, the path to the RDF/XML file (must start with /).
- $port, the port on the WWW host (optional, default is 80).
- $maxitems, the maximum number of items to display (optional,
default is 0 for all items).
- Multi line based news files where news items are described over several
lines with at least one for the title and one for the link. Optionaly,
the news item may be delimited by a separator line (like %%). In
that case all lines up to the first separator are ignored.
function blocknewsparser($hosttitle, $hostname, $backend, $argdesc,
$separ = "", $maxitems = 0, $port = 80);
- $hosttile, the name of the host.
- $hostname, the address of the host.
- $backend, the path to the text news file (must start with /).
- $argdesc, an array of strings describing the meaning of each
line. At least one of these items must be called "info" (the title of
the news item) and another "link" (the URL).
- $separ, separating line (default is empty, ie no separator).
- $maxitems, the maximum number of items to display (optional,
default is 0 for all items).
- $port, the port on the WWW host (optional, default is 80).
- Single lines based news files where news items are described on a single
line and fields are separated by a delimiter.
|  |