24 Nov 2002 Stevey   » (Master)

Bookmarks

 Because Mozilla still doesn't support roaming profiles I've ended up with a couple of machines all having wildly different bookmark collections.

 Needless to say this is a bad thing, and makes me very irritated on a regular basis.

 So I spent 30 minutes yesterday writing a little Perl script to merge multiple Netscape/Mozilla bookmark collections together.

 It's a complete hack, but it works in a sufficiently roundabout way that I'm fairly proud of it!

Merging Bookmarks

 I thought it would be trivial to parse the bookmarks from one `bookmarks.html` file into a tree structure, then parse a second file; walking down the tree to spot nodes or leaves in common and adding them to a third tree - which could then be written out to disk.

 But when I actually came to code it I realised that I could cheat as I already had written a program to convert between Internet Explorer Favourites and bookmark files a few years ago. (See if you can spot where this is going!)

 So .. my new script simple reads in each bookmark file, converts it to IE favourite files in a temporary directory, (not caring if the files already exist; which handles duplicate subtrees or entries), then after that converts the collection of .url files back into a bookmark file.

 Roundabout .. but kinda cool

 I'll tidy it up and stick it online later today if I get the chance..

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!