Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

URI::Bookmarks
Perl module class encapsulating bookmark files

URI::Bookmarks - Perl module class encapsulating bookmark files


NAME

URI::Bookmarks - Perl module class encapsulating bookmark files


SYNOPSIS


  use URI::Bookmarks;

  # URI::Bookmarks automagically detects that we're dealing with a

  # collection of Netscape bookmarks

  my $bookmarks =

    new URI::Bookmarks(file => "$ENV{HOME}/.netscape/bookmarks.html");

  my $bookmarks = new URI::Bookmarks(handle => $fh);

  my $bookmarks = new URI::Bookmarks(array => \@lines);

  

  # Manipulate $bookmarks using nice tree methods from Tree::DAG_Node,

  # e.g. delete all bookmarks under $folder:

  ($bookmarks->name_to_nodes($folder))[0]->unlink_from_mother();

  # Then output the new file.

  print $bookmarks->export('Netscape array');


DESCRIPTION

URI::Bookmarks provides a class for manipulating hierarchical collections of bookmarks. Each entry in the collection is an object of type URI::Bookmark, which is in turn a subclass of Tree::DAG_Node, and hence all standard tree manipulation methods are available (see the documentation for Tree::DAG_Node).

  • build_name_lookup
  • 
      $bookmarks->build_name_lookup();

    This method builds an internal hash which maps node names to arrays of nodes which have the corresponding key as their name.

    It only needs to be called if you want to rebuild the hash after modifying the bookmark collection in some way; if the hash is needed and has not been built, it will be built automatically.

  • tree_root
  • 
      my $tree_root_node = $bookmarks->tree_root();
    
      $bookmarks->tree_root($new_root);

    Returns the current root node of the tree of bookmarks. If the optional parameter is provided, the root node is changed to it.

  • name_to_nodes
  • 
      my @nodes = $bookmarks->name_to_nodes('Cinemas');

    Returns an array of all nodes matching the given name.

  • title
  • 
      my $title = $bookmarks->title();
    
      $bookmarks->title($new_title);

    Returns the current title of the collection of bookmarks. If the optional parameter is provided, the title is changed to it.

  • origin
  • 
      my $origin = $bookmarks->origin();
    
      my $origin_type = $origin{type};

    Returns a hash containing information about the origin of the collection of bookmarks.

  • export
  • 
      my @lines = $bookmarks->export('Netscape array');

    The interface to the export routines. The examples above show the currently available export types.

  • all_URLs
  • 
      $bookmarks->all_URLs();

    This method simply returns an array of all the URLs in the collection of bookmarks.


BUGS

The file key of new() might not be safe.


AUTHOR

Adam Spiers <adam@spiers.net>


SEE ALSO

the URI::Bookmarks::* manpage, the URI::Bookmark manpage, the URI::Bookmark::* manpage, perl(1).

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy