Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Netscape::Bookmarks 1.94

    Download button

    No screenshots available
    Downloads: 333  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    brian d foy | More programs
    Perl Artistic License / FREE
    March 24th, 2007, 10:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Netscape::Bookmarks description

    Netscape::Bookmarks is a Perl module to parse, manipulate, or create Netscape Bookmarks files.

    Netscape::Bookmarks is a Perl module to parse, manipulate, or create Netscape Bookmarks files.

    SYNOPSIS

    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;

    [ Note: I wrote this a long time ago. Although this should still work with "Netscape" browsers, Mozilla browsers do the same thing. When the docs say "Netscape", I mean either branch of browsers. ]

    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::Category object, 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::Parser is used behind the scenes to build the data structure (a simple list of lists (of lists ...)). Netscape::Bookmarks::Category, Netscape::Bookmarks::Link, Netscape::Bookmarks::Alias, or Netscape::Bookmarks::Separator objects can be stored in a Netscape::Bookmarks::Category object. Netscape::Bookmarks::Alias objects are treated as references to Netscape::Bookmarks::Link objects, so changes to one affect the other.

    Methods for manipulating this object are in the Netscape::Bookmarks::Category module. Methods for dealing with the objects contained in a Netscape::Bookmarks::Category object are in their appropriate modules.

    new( [filename] )

    The constructor takes a filename as its single (optional) argument. If you do not give new an argument, an empty Netscape::Bookmarks::Category object is returned so that you can start to build up your new Bookmarks file. If the file that you name does not exist, undef is returned in scalar context and an empty list is returned in list context. If the file does exist it is parsed with HTML::Parser with the internal parser subclass defined in the same package as new. If the parsing finishes without error a Netscape::Bookmarks::Category object is returned.

    parse_string

    Method for HTML::Parser subclass method

    start

    Method for HTML::Parser subclass method

    text

    Method for HTML::Parser subclass method

    end

    Method for HTML::Parser subclass method

    my_init

    Method for HTML::Parser subclass method

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Netscape Bookmarks | parse bookmarks | manipulate bookmarks | Netscape::Bookmarks | parse | manipulate

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM