NAME

URI::Collection - Input and output link collections in different formats.

SYNOPSIS

use URI::Collection;

$collection = URI::Collection->new (
    file      => $bookmarks,
    directory => $favorites,
);

$bookmarks = $collection->as_bookmark_file (
    save_as => $file_name,
);

$favorites = $collection->as_favorite_directory (
    save_as => $directory_name,
);

ABSTRACT

Input and output link collections in different formats.

DESCRIPTION

An object of class URI::Collection represents a parsed Netscape style bookmark file or a Windows "Favorites" directory with multi-format output methods.

METHODS

new

$collection = URI::Collection->new (
    file      => $bookmarks,
    directory => $favorites,
);

Return a new URI::Collection object.

This method mashes link store formats together, simultaneously.

as_bookmark_file

$bookmarks = $collection->as_bookmark_file (
    save_as => $file_name,
);

Output a Netscape style bookmark file as a string with the file contents.

Save the bookmarks as a file to disk, if asked to.

as_favorite_directory

$favorites = $collection->as_favorite_directory (
    save_as => $directory_name,
);

Write an M$ Windows "Favorites" folder to disk and output the top level directory name.

A specific directory name can be provided for the location of the Favorites tree to write. If one is not provided, a folder named "Favorites-" with the system time stamp appened is written to the current directory.

DEPENDENCIES

Carp

Cwd

File::Spec

File::Find

File::Path

Config::IniFiles

Netscape::Bookmarks::Alias

TO DO

Make proper tests, damnit!

Throw out redundant links.

Optionally return the M$ Favorites directory structure (as a variable) instead of writing it to disk.

Handle the top Favorites path better - possibly just rename the first directory containing *.url files.

Allow input/output of file and directory handles.

Allow slicing of the category-links structure.

Add a method to munge a set of links as bookmarks or favorites after the constructor is called.

Allow this link munging to happen under a given category.

Check if links are active.

Update link titles and URLs if changed or moved.

Mirror links?

Handle other bookmark formats (if there even are any) and "raw" lists of links, to justify such a generic package name. :-)

Move the Favorites input/output functionality to a seperate module like "URI::Favorites::IE::Windows" and "URI::Favorites::IE::Mac", or some such.

Make a separate module for building an OmniWeb bookmark file, instead of naively reconstituting one as a Netscape bookmark file.

Make the internal hash structure an object attribute, instead of a global variable.

THANK YOU

A special thank you goes to my friends on rhizo #perl for answering my random questions. : )

AUTHOR

Gene Boggs <cpan@ology.net>

COPYRIGHT AND LICENSE

Copyright 2003 by Gene Boggs

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.