NAME

Video::TeletextDB::Page - Postprocessing Video::TeletextDB pages

SYNOPSIS

use Video::TeletextDB;
$tele_db	= Video::TeletextDB->new(...);
$access	= $tele_db->access(...);
$page		= $access->fetch_page($page_nr, $subpage_nr);
@pages	= $access->fetch_page_versions($page_nr, $subpage_nr);

$text		= $page->text;
@text		= $page->text;
$html		= $page->html(%parameters);
$style	= Video::TeletextDB::Page->html_style;

$time		= $page->time;
$page_nr	= $page->page_nr;
$subpage_nr	= $page->subpage_nr;

DESCRIPTION

A Video::TeletextDB::Page object represents one presentable page. Each character on the page has attributes like foreground color, size etc. Here you'll find methods to extract this information.

METHODS

All presentation methods by default present mosaic (the name used for a set of very primitive 3x2 grapics blocks occupying one character position) as # except for the empty mosaic which is shown as .

Currently only does level 1 Teletext. More may get added later.

$text = $page->text
@text = $page->text

Returns the page as pure text with all attributes removed. In list context it returns one element per line (each line will have a newline at the end). In scalar context it returns the concatenation of all lines.

$html = $page->html(%parameters)

Returns a block of html text representing the page. Currently the only attributes used to build the html are colors and links. Ranges with a certain attribute are wrapped in <span> tags. You still have to apply a style sheet to make them do something. A default style sheet is available as the html_style method.

Parameters are name/value pairs, which can be:

Extra arguments passed to the formats described below. Typically used to propagate a query string.

Defaults to "" if not given.

Whenever a link to a teletext page (without a subpage number) is recognized, it's run through sprintf with $page_format as format and the decimal page number (followed by any linkargs) as argument. The result is then html escaped and used in a quoted href.

Defaults to ../%03x/%s if not given.

Whenever a link to a teletext page with a subpage number is recognized, it's run through sprintf with $subpage_format as format and the decimal page and subpage number (followed by any linkargs) as arguments. The result is then html escaped and used in a quoted href.

Defaults to ../%03x/%02x%s if not given.

uri => $uri_format

Whenever an URI is recognized in the teletext page, it's run through sprintf with $uri_format as format and the URI (followed by any linkargs) as arguments. The result is then html escaped and used in a quoted href.

Defaults to %s if not given.

$style = Video::TeletextDB::Page->html_style

Returns a default stylesheet (without headers) intended to be used with the html method. It's basically the style sheet from alevtd.

$time = $page->time

Returns the time associated with this page (meant to be the time the page was extracted from the teletext stream).

$page_nr = $page->page_nr

Returns the decimal page number of this page.

$subpage_nr = $page->subpage_nr

Returns the decimal subpage number of this page

EXPORT

None by default.

SEE ALSO

Video::TeletextDB, Video::TeletextDB::Access, alevtd(1), http://zapping.sourceforge.net/cgi-bin/view/ZVBI/WebHome

AUTHOR

Ton Hospel, <Video-TeletextDB@ton.iguana.be>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Ton Hospel

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.