Why not adopt me?
NAME
Netscape::Bookmarks::Link - manipulate, or create Netscape Bookmarks links
SYNOPSIS
use Netscape::Bookmarks::Bookmarks;
my $category = new Netscape::Bookmarks::Category { ... };
my $link = new Netscape::Bookmarks::Link {
TITLE => 'this is the title',
DESCRIPTION => 'this is the description',
HREF => 'http://www.perl.org',
ADD_DATE => 937862073,
LAST_VISIT => 937862073,
LAST_MODIFIED => 937862073,
ALIAS_ID => 4,
}
$category->add($link);
#print a Netscape compatible file
print $link->as_string;
DESCRIPTION
The Netscape bookmarks file has several basic components:
title
folders (henceforth called categories)
links
aliases
separators
On disk, Netscape browsers store this information in HTML. In the browser, it is displayed under the "Bookmarks" menu. The data can be manipulated through the browser interface.
This module allows one to manipulate the links in for a Netscape bookmarks file. A link has these attributes, only some of which may be present:
title
description
HREF (i.e. URL)
ADD_DATE
LAST_MODIFIED
LAST_VISIT
ALIAS_OF
ALIAS_ID
These are explained below.
METHODS
$obj->href
Returns the URL of the link. The URL appears in the HREF attribute of the anchor tag.
$obj->title
Returns the link title.
$obj->append_title
Adds to the title - used mostly for the HTML parser, although it can be used to add a title if none exists (which is an error, though).
$obj->description
Returns the link description.
$obj->append_description
Adds to the description - used mostly for the HTML parser, although it can be used to add a description if none exists.
$obj->add_date
Returns the date when the link was added, in Unix epoch time.
$obj->last_visit
Returns the date when the link was last vistied, in Unix epoch time. Returns zero if no information is available.
$obj->last_modified
Returns the date when the link was last modified, in Unix epoch time. Returns zero if no information is available.
$obj->alias_id
Returns the alias id of a link. Links with aliases are assigned an ALIAS_ID which associates them with the alias. The alias contains the same value in it's ALIAS_OF field. The Netscape::Bookmarks::Alias module handles aliases as references to Netscape::Bookmarks::Link objects.
$obj->as_string
Returns a Netscape compatible bookmarks file based on the Bookmarks object.
TO DO
Add methods for manipulating attributes
AUTHOR
brian d foy <comdog@panix.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
HTML::Parser, Netscape::Bookmarks::Category, Netscape::Bookmarks::Link, Netscape::Bookmarks::Alias, Netscape::Bookmarks::Separator.