NAME
URI::Collection - Input and output link collections in different formats
SYNOPSIS
use URI::Collection;
$collection = URI::Collection->new(
links => $bookmark_file,
);
$collection = URI::Collection->new(
links => $favorite_directory,
);
$collection = URI::Collection->new(
links => [ $bookmark_file, $favorite_directory ],
);
$links = $collection->fetch_items(
category => $regexp_1,
title => $regexp_2,
url => $regexp_3,
);
$bookmarks = $collection->as_bookmark_file(
save_as => $bookmark_file,
);
$favorites = $collection->as_favorite_directory(
save_as => $favorite_directory,
);
DESCRIPTION
An object of class URI::Collection
represents the links and categories in parsed Netscape style bookmark files and Windows "Favorites" directories, with output in either style.
METHODS
new
$collection = URI::Collection->new(
links => $bookmark_file,
);
$collection = URI::Collection->new(
links => $favorite_directory,
);
$collection = URI::Collection->new(
links => [ $bookmark_file, $favorite_directory ],
);
Return a new URI::Collection
object.
This method mashes link store formats together, simultaneously.
as_bookmark_file
$bookmarks = $collection->as_bookmark_file(
save_as => $bookmark_file,
);
Output a Netscape style bookmark file as a string with the file contents.
Optionally, save the bookmarks as a file to disk, if given a save_as
argument.
as_favorite_directory
$favorites = $collection->as_favorite_directory(
save_as => $favorite_directory,
);
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.
fetch_items
$items = $collection->fetch_items(
category => $regexp_1,
title => $regexp_2,
url => $regexp_3,
);
Return a list of links and collections of links that have titles, urls or categories similar to the given regular expressions.
If no arguments are provided, no links are returned. This must change (in the next release)!
Note that if a category argument is supplied, only links under matching categories will be found. If no category argument is provided, and link with a matching title or url will be returned.
DEPENDENCIES
TO DO
Allow restriction of link fetching for any saved information (not just category, title and url).
Return all links and categories if no arguments are provided to the fetch_items
method.
Ignore redundant links.
Optionally return the M$ Favorites directory structure (as a variable) instead of writing it to disk.
Allow input/output of file and directory handles.
Allow slicing of the category-links structure.
Allow link munging to happen under a given category or categories only.
Check if links are active.
Update link titles and URLs if changed or moved.
Mirror links?
Handle other bookmark formats (including some type of generic XML), and "raw" (CSV) lists of links, to justify such a generic package name. This includes different platform flavors of every browser.
Move the Favorites input/output functionality to a seperate module like URI::Collection::Favorites::IE::Windows
and URI::Collection::Favorites::IE::Mac
, or some such. Do the same with the above mentioned "platform flavors", such as Opera and Mosaic "Hotlists", and OmniWeb bookmarks, etc.
SEE ALSO
There are an enormous number of web-based bookmark managers out there (see http://useful.webwizards.net/wbbm.htm), which I don't care about at all. What I do care about are multi-format link converters. Here are a few that I found:
Online manager: http://www.linkagogo.com/
CDML Universal Bookmark Manager (for M$ Windows only): http://www.cdml.com/products/ubm.asp
OperaHotlist2HTML: http://nelson.oit.unc.edu/~alanh/operahotlist2html/
bk2site: http://bk2site.sourceforge.net/
Windows favorites convertor: http://www.moodfarm.demon.co.uk/download/fav2html.pl
bookmarker: http://www.renaghan.com/pcr/bookmarker.html
Columbine Bookmark Merge: http://home.earthlink.net/~garycramblitt/
XBEL Bookmarks Editor: http://pyxml.sourceforge.net/topics/xbel/
And here are similar perl modules:
BabelObjects::Component::Directory::Bookmark
THANK YOU
A special thank you goes to my friends on rhizo #perl for answering my random questions. : )
AUTHOR
Gene Boggs <gene@cpan.org>
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.