NAME
Netscape::HistoryURL - URI::URL subclass with Netscape history information
SYNOPSIS
use Netscape::HistoryURL;
$url = new Netscape::HistoryURL('http://foobar.com/',
LAST, FIRST, COUNT, EXPIRE, TITLE);
DESCRIPTION
The Netscape::HistoryURL
module subclasses URI::URL to provide a URL class with methods for accessing the information which is stored in Netscape's history database.
The history database is used to keep track of all URLs you have visited. This is used to color previously visited URLs different, for example. The information stored in the history database depends on the version of Netscape being used.
CONSTRUCTOR
$object = new Netscape::HistoryURL( URL,
LAST, FIRST, COUNT, EXPIRE, TITLE );
This creates a new instance of the Netscape::HistoryURL object class. This supports all the methods supported by the URI::URL class. Please see the documentation for that module.
The first argument passed is a string which contains a valid URL. The remaining arguments are information (usually) extracted from Netscape's history database.
LAST is the time the URL was last visited, and FIRST is the time when the URL was first visited. COUNT is the number of times you have visited the URL. We're not really sure what EXPIRE is yet. TITLE is the title of the referenced page.
You will normally not use the constructor yourself; it is usually invoked by the next_url()
method of the Netscape::History class.
METHODS
The Netscape::HistoryURL class supports all methods of the URI::URL class, and additional methods as described below. Please see the documentation for URI::URL for details of the other methods supported.
visit_time - return the time of last visit
$time = $url->visit_time();
This routine is provided for backwards compatibility with the previous versions of this module. You should use last_visit_time()
instead.
first_visit_time - the time you first visited the URL
$time = $url->first_visit_time();
This method returns the time you first visited the URL, in seconds since the last epoch. This can then be used with any of the standard routines for formatting as a string. The following example uses ctime(), from the Date::Format module:
print "Time of last visit for $url : ", ctime($url->first_visit_time);
last_visit_time - the time you last visited the URL
$time = $url->last_visit_time();
This method returns the time you last (most recently) visited the URL, in seconds since the last epoch.
title - the title of the associated page
$title = $url->title();
This method returns the title of the referenced page, if one was available. The value will be undef
otherwise.
visit_count - the number of times you have visited the page
$count = $url->visit_count();
This method returns the number of times you have visited the page.
expire - the expire value for the URL
$expire = $url->expire();
This method returns the expire values which is stored for the URL. We don't know what this is for yet, or the right way to interpret it.
SEE ALSO
- Netscape::History
-
An object class for accessing the Netscape history database.
- URI::URL
-
Base-class, which provides heaps of functionality.
AUTHOR
Neil Bowers <neilb@cre.canon.co.uk> and Richard Taylor <rit@cre.canon.co.uk>.
COPYRIGHT
Copyright (c) 1997-1999 Canon Research Centre Europe. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.