Netscape::Bookmarks::Link - manipulate, or create Netscape Bookmarks links
use Netscape::Bookmarks::Bookmarks; my $category = Netscape::Bookmarks::Category->new( { ... } ); my $link = Netscape::Bookmarks::Link->new( { 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;
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.
Creates a new Link object. The hash reference argument can have the following keys to set the properties of the link:
HREF ADD_DATE LAST_MODIFIED LAST_VISIT ALIASID ALIASOF
Returns the URL of the link. The URL appears in the HREF attribute of the anchor tag.
Returns the date when the link was added, in Unix epoch time.
Returns the date when the link was last modified, in Unix epoch time. Returns zero if no information is available.
Returns the date when the link was last vistied, in Unix epoch time. Returns zero if no information is available.
Returns the link title.
Returns the link description.
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.
Returns a Netscape compatible bookmarks file based on the Bookmarks object.
Add methods for manipulating attributes
This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.
http://sourceforge.net/projects/nsbookmarks/
If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.
brian d foy, <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright (c) 2002-2007 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Netscape::Bookmarks
To install Netscape::Bookmarks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Netscape::Bookmarks
CPAN shell
perl -MCPAN -e shell install Netscape::Bookmarks
For more information on module installation, please visit the detailed CPAN module installation guide.