21 Jul 2019 23:02:03 UTC
- Distribution: Netscape-Bookmarks
- Module version: 2.304
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (1)
- Testers (64 / 0 / 5)
- KwaliteeBus factor: 0
- 78.16% Coverage
- License: artistic_2
- Perl: v5.10.0
- Activity24 month
- Download (44.32KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionBDFOY brian d foy
Why not adopt me?This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.
Netscape::Bookmarks - parse, manipulate, or create Netscape Bookmarks files
use Netscape::Bookmarks; # parse an existing file my $bookmarks = Netscape::Bookmarks->new( $bookmarks_file ); # -- OR -- # start a new Bookmarks structure my $bookmarks = Netscape::Bookmarks->new; # print a Netscape compatible file print $bookmarks->as_string;
THIS IS AN ABANDONED MODULE. THERE IS NO SUPPORT. YOU CAN ADOPT IT IF YOU LIKE: https://pause.perl.org/pause/query?ACTION=pause_04about#takeover
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 bookmarks file programmatically. One can parse an existing bookmarks file, manipulate the information, and write it as a bookmarks file again. Furthermore, one can skip the parsing step to create a new bookmarks file and write it in the proper format to be used by a Netscape browser.
The Bookmarks module simply parses the bookmarks file passed to it as the only argument to the constructor:
my $bookmarks = Netscape::Bookmarks->new( $bookmarks_file );
The returned object is a
Netscape::Bookmarks::Categoryobject, since the bookmark file is simply a collection of categories that contain any of the components listed above. The top level (i.e. root) category is treated specially and defines the title of the bookmarks file.
HTML::Parseris used behind the scenes to build the data structure (a simple list of lists (of lists ...)).
Netscape::Bookmarks::Separatorobjects can be stored in a
Netscape::Bookmarks::Aliasobjects are treated as references to
Netscape::Bookmarks::Linkobjects, so changes to one affect the other.
Methods for manipulating this object are in the
Netscape::Bookmarks::Categorymodule. Methods for dealing with the objects contained in a
Netscape::Bookmarks::Categoryobject are in their appropriate modules.
- new( [filename] )
The constructor takes a filename as its single (optional) argument. If you do not give
newan argument, an empty
Netscape::Bookmarks::Categoryobject is returned so that you can start to build up your new Bookmarks file. If the file that you name does not exist,
undefis returned in scalar context and an empty list is returned in list context. If the file does exist it is parsed with
HTML::Parserwith the internal parser subclass defined in the same package as
new. If the parsing finishes without error a
Netscape::Bookmarks::Categoryobject is returned.
brian d foy
Copyright © 2002-2019, brian d foy <email@example.com>. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
Module Install Instructions
To install Netscape::Bookmarks, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Netscape::Bookmarks
For more information on module installation, please visit the detailed CPAN module installation guide.