How to import dillo bookmarks into Firefox etc


Forum: Other Help Topics
Topic: How to import dillo bookmarks into Firefox etc
started by: WoofyDugfock

Posted by WoofyDugfock on Mar. 17 2005,16:36
If like me you use dillo a lot and have accumulated heaps of useful bookmarks, you may have noticed that the dillo bookmarks file /home/dsl/.dillo/bm.txt cannot be imported into your Firefox bookmarks - it's in the wrong format. Grrrr!!!

Opening your bookmarks page within dillo and saving as html won't help either.

Frustrated that I couldn't get Gnobog to import dillo bookmarks either and not able to google an existing remedy anywhere, I took some inspiration from Dawid Michalczyk's urlext.sh (GNU GPL), and wrote the little convert_dillobm.sh (see below).

To convert dillo bookmarks into a standard format & import into Firefox:

1. Open a shell, cd to the directory containing the script and enter ./convert_dillobm.sh ~/.dillo/bm.txt
2. This will output the converted file dillobm_converted.html in the directory in which you ran the script.
3. In Firefox, go bookmarks menu --> manage bookmarks -->file --> Import...-->from file -->(browse to dillobm_converted.html and select). That's it.

The dillo bookmarks are now incorporated into your Firefox bookmarks.

Hope this is useful.

----------------------------------------------------------------
#! /bin/bash

# Title: convert_dillobm.sh
# Author: WoofyDugfock on dsl forum
# Date: 2005.03.17 Amended: 2005.03.18
# Purpose: Converts  dillo bookmarks file (bm.txt) argument into a standard bookmarks html file
#- suitable for importing into Firefox etc
# Distribution: GNU GPL

{
echo "<html><head><title>Bookmarks converted from: $1 </title></head><body>"
awk '/http/{$1="";print}' $1 | while read ADR TIT; do
echo "<a href=\""${ADR}\"">"$TIT"</a><br>"
done
echo "</body></html>"
} >dillobm_converted.html #output file

exit 0

Posted by gunnix on Mar. 22 2005,22:07
very nice, have you contacted the dillo developers? Maybe they could put it on their site as well?

grtz

Posted by WoofyDugfock on Mar. 24 2005,16:03
Thx Gunnix.

While the above does import into FF ok, at least one bookmarks management program barfs & complains that the output from convert_dillobm.sh is not EXACTLY Mozilla format ie it's corrupted.

Below is a modified version that produces something a bit closer to a Firefox bookmarks clone. It may still give a "bad signature" message (because it doesn't have the FF comment lines!) but should be imported anyway.

RE: Dillo people - I haven't contacted them because they'd be well aware that their bm file is in non-standard format and this script is pretty basic  - they'd produce it themselves if they felt like it.  But by all means you should email them if you wish - maybe they'd get the message that they need to make their bm file importable in future releases.

Code Sample


#! /bin/bash

# Title: convert_dillobm.sh
# Author: WoofyDugfock on dsl forum
# Date: 2005.03.17 Updated 2005.03.24
# Purpose: Converts  dillo bookmarks file (bm.txt) argument into a standard  html format akin to Firefox bookmarks
#- suitable for importing into Firefox etc
# Distribution: GNU GPL

{
cat <<EOF
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>

<DL><p>
   <DT><H3 ADD_DATE="1111700525" LAST_MODIFIED="1111701745" PERSONAL_TOOLBAR_FOLDER="true" ID="rdf:#$XZzXO3">Bookmarks Toolbar Folder</H3>
   <DL><p>
EOF

awk '/http/{$1="";print}' $1 | while read ADR TIT; do
echo "        <DT><A HREF=\""${ADR}\"" ADD_DATE="1111701745" LAST_CHARSET="UTF-8" ID="rdf:#$nsWFX">"$TIT"</A>"
done

cat <<EOF2
   </DL><p>
</DL><p>
EOF2
} >dillobm_converted.html #output file

exit 0

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.