BrT

Musings about technology and other neat stuff

BrT random header image

Converting Sogudi bookmarks to Firefox (HOWTO)

December 11th, 2005 · Comments

I’ve been using Safari on my Mac since Tiger came out, but with Firefox 1.5 being released, I’ve decided to give it another try (I use Firefox on Linux, but I haven’t been very happy with it on the Mac before). It properly imported my Safari bookmarks, settings and even the cookies! Quite impressive. the only missing thing were my Sogudi bookmarks, the equivalent of Firefox’s keyword searches. So I wrote the following short Perl script to do the conversion:

#!/usr/bin/perl -w
while (<>) {
  if (/\<key\>(.+)\<\/key/) {
    $key=$1;
    $str=<>;
    if ($str =~ /\<string\>(.+)\<\/string/) {
      ($url=$1)=~s/\@\@\@/\%s/g;
      $time=time();
      print qq(<DT><A HREF="$url" ADD_DATE="$time" SHORTCUTURL="$key">$key</A>\n);
    }
  }
}

Run it like this:

perl sogudi2firefox.pl SogudiShortcuts.plist

And insert the output in an appropriate place in your ~/Library/Application Support/Firefox/Profiles/xxxxxx/bookmarks.html file.

Technorati Tags: ,

Tags: ·