# Export Live Bookmarks from Firefox bookmarks.html to an OPML file my ($bookmarks, $outfile) = @ARGV; open(BOOKMARKS, $bookmarks) || die("Can\'t read $bookmarks\n"); open(OPML, ">$outfile") || die("Can\'t open output file $outfile for writing\n"); print OPML qq{ Firefox Live Bookmarks }; while() { if ($_ =~ /FEEDURL\=\"([^\"]+)\"/) { $feedurl = $1; ($title) = ($_ =~ /\>([^\<]+)\<\/A\>/ ); ($htmlurl) = ($_ =~ /HREF\=\"([^\"]+)\"/ ); print OPML qq{ } } } print OPML qq{ }; # Done!