OperaHotlist2HTML is a Perl script that converts Opera bookmarks (called "Hotlist") to HTML 4.01. It will also convert to Netscape/Mozilla compatible bookmark files as well. By default, it doesn't process the creation or last visited dates to help ensure privacy of the users. It may be distributed under the conditions of the Gnu General Public License.

Given this sample hotlist as input, here is a basic sample of output html from the program and here is a sample Mozilla-compatible bookmark file. For another example, here is my personal bookmark file as generated by this command-line.


   $  operahotlist2html [ options ] [ < INPUT.adr ] [ > OUTPUT.html ]

By default, it reads from STDIN and writes to STDOUT.


  -h, --help                   Print this help message
  -q, --quiet                  Supress warning messages
  -v, --version                Print version
      --debug                  Print debugging output to STDERR
  -i, --input=PATH             Use this file as input instead of STDIN
  -o, --output=PATH            Output to this file instead of STDOUT
  -d, --header=STRING          Heading at top of page
  -t, --title=STRING           Title in HTML header
  -s, --style=STRING           Stylesheet for output HTML
      --google-analytics       Include Google Analytics script
      --descr-sep=STRING       HTML to Separate descript from title
  -x, --exclude-folder=STRING  Regular expression of folders to exclude
                                  e.g. "\A(News and Weather|Sports)\Z"
      --no-favicons            Don't include favicons in output.
      --favicon-size=STRING    Force height, width of favicons.
  -m, --mozilla                Generate Mozilla/Netscape bookmark file
      --include-dates          In Mozilla output, include bookmark dates
      --unsort-folder-list     Print folder list unsorted
      --include-extra-folders  Include the 'Find Results' and 'Trash' folders
  -r, --hr=STRING              HTML for a separator instead of <hr>
  -n, --nodateontop            Print datestamp only at bottom


By default, it reads from standard in and writes to standard out. So you could do for instance:

   $ operahotlist2html  < ~/.opera/opera.adr > htmlfile.html  

Or an equivalent command which uses command line options instead of pipes:

   $ operahotlist2html  -i $HOME/.opera/opera.adr -o htmlfile.html

Or if you want to create a file for import into Mozilla:

   $ operahotlist2html  -i $HOME/.opera/opera.adr -o htmlfile.html \
                  --mozilla --include-dates

Here is a more elaborate HTML output example:

   $ operahotlist2html \
             --title='Hotlist for somebody' \
             --header='<h1>Hotlist for <a href="index.html">this user</a></h1>' \
             --style='someCSSfile.css' \
	     --descr-sep='<br>&nbsp;&nbsp;&nbsp;&nbsp;&mdash; ' \
             --hr='<hr width="50%">' \
             --input=$HOME/.opera/opera6.adr \

This program was originally written for Opera for Linux, but as of version 2.9 it works on Opera for Windows hotlists without modification of the hotlist. You will need to install perl and modify the first line to get it to work (e.g. try something like #!c:/perl/bin/perl.exe -w) . Previous versions required converting the hotlist to unix text format with programs such as dos2unix or recode.


The current version is always available at: http://www.alanhoyle.com/operahotlist2html/dist/oph2h.tar.gz

The fully expanded filename is: operahotlist2html-2.15.tar.gz

Old versions are available here: http://www.alanhoyle.com/operahotlist2html/dist or at SourceForge.net

The "daily binary" version is available at operahotlist2html

SourceForge Logo FreshMeat Logo I also announce current releases and make them available at: http://sourceforge.net/projects/ophotlist2html/ and at http://freshmeat.net/projects/ophotlist2html/

Miscellaneous info:

Opera 7 includes "export bookmarks to html" functionality similar to this program, however there are still reasons to use this script:

For further comparison, here is a sample of the HTML export from Opera 7 and here is sample of output html from my program both from the same Hotlist.

Valid HTML might not be generated if the folder names contain non-alpha-numeric characters. According to the HTML specifications [1] [2]:

"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")."

Ami Fischman contributed this diff file which, when applied to OperaHotlist2HTML version 1.3, changes the output to something that Netscape can grok as a bookmark file (i.e. the ~/.netscape/bookmarks.html). This is completely redundant as of version 2.6, as you can use the --mozilla --include-dates command line options to generate similar output.

Rijk van Geijtenbeek <rijk@opera.com> contributed significant updates to 2.12. He even uses it himself. In particular, he did the following:

You might also be interested in the following:

The OperaHotlist2HTML perl code is based on hotlist2xbel written by Haakon Nilsen <haakon@nilsen.com>. http://sips.midian.net/hotlist2xbel/ The direct link no longer works. You might try http://quit.net/~haakon/.


Valid XHTML 1.1!Valid CSS!Best viewed with ANY browser.

© Alan Hoyle
Last update: $Id: index.html,v 1.30 2006/06/07 18:38:45 alanh Exp $
Originally created: 23 March 2001