Jump to content

Converting Opera Bookmarks to HTML


Cannonfodder
 Share

Recommended Posts

Here's a nifty little program.

 

http://nelson.oit.unc.edu/~alanh/operahotlist2html/

 

To use it,

 

1. mkdir opera2html and copy targz file into it.

2. tar xzf oph2h.tar.gz

3. mv opera2html /usr/lib

4. ln -s /usr/lib/opera2html/opera2html /usr/bin/opera2html

 

The last puts it on the path so that you can

 

opera2html < Opera6.adr > bookmark.html

 

Then you can open the file with opera..

Link to comment
Share on other sites

More or less like this :mrgreen: :

~$ awk 'BEGIN {RS="#URL"; FS="n"} $3 ~ /URL=/ {print gensub("^.+NAME=(.+).+URL=(.+)","<a href="2">1</a><br />","g",$2 $3)}' < opera6.adr | tee bookmark.html



<a href="http://tldp.org/LDP/abs/html/index.html">Advanced Bash-Scripting Guide</a><br />

<a href="http://www.opera.com/order/">Buy Opera</a><br />

[...]

<a href="http://www.linux.org/">linux.org</a><br />

<a href="http://linuxapps.com/">linuxapps.com</a><br />

<a href="http://kt.linuxcare.com/">Linuxcare</a><br />

<a href="http://www.linuxcentral.com/">linuxcentral.com</a><br />

<a href="http://www.linuxhq.com/">linuxhq</a><br />

<a href="http://linuxiso.org/">linuxiso.org</a><br />

<a href="http://www.linuxmafia.org/">linuxmafia</a><br />

<a href="http://www.linuxnewbie.org/">linuxnewbie.org</a><br />

<a href="http://www.linuxprogramming.com/">linuxprogramming</a><br />

<a href="http://www.linuxstart.com/">linuxstart</a><br />

<a href="http://linuxtoday.com/">linuxtoday.com</a><br />

<a href="http://www.lutelinux.com/">lutelinux.com</a><br />



~$

 

Ofcourse, if you want also dates, sections, headers... just add a few bits of code... linux is so cool!

 

:P

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Tried to follow Cannonfodder's steps above but so far no joy. Can someone please help me learn what I am doing wrong? :oops:

 

I want to import my Opera 6.12 bookmarks to Mozilla.

 

I made a temp directory opera2html and expanded the file. Then I think my problems began with following steps 3 & 4

3. mv opera2html /usr/lib

4. ln -s /usr/lib/opera2html/opera2html /usr/bin/opera2html

 

Does this mean I should move the newly created directory opera2html or just the file opera2html?

 

I copied the directory because step 4 makes it look like a directory is involved since opera2html is doubled in the first part... Is that an error or do I need to transfer the directory? This is where I am a bit confused . :?

 

I tried to run the command from within the /home/kelly/opera directory

opera2html < Opera6.adr > bookmark.html
but get the error "no such command" as both root and user... I figured out the Opera6.adr is a typo as the file is opera6.adr (no cap) but get same error after correcting that.

 

What am I missing? :)

Link to comment
Share on other sites

Yahoo! Got it! Took a bit of trying, but helped me learn a bit in the process. :lol:

 

Problem was the file names and syntax things. I'll try to recap

 

Steps 1 & 2 are Ok... might need to explain the downloaded is .tgz and needs to be uncompressed twice.

 

Step 3: I am still not sure why, but I moved the whole directory since the sym link suggested in step 4 refers to it.

 

QUESTION: couldn't you just move the operahotlist2html script file rather than the directory? or is there a safety/convenience reason for this?

 

Step 4: I followed it as per above.

 

The last step though I changed and followed the instructions on the author's webpage. Instead of

opera2html < Opera6.adr > bookmark.html

 

I did

[kelly@localhost opera2html]$ opera2html -i $HOME/.opera/opera6.adr -o htmlfile.html --mozilla --include-dates

and got an error message (no problem just info)

Warning:  -m or --mozilla option breaks HTML 4.01 compliance.

 

Then I used Bookmark Manager in Mozilla to import the htmlfile.html into Mozilla. Seemed to work fine after I made these minor changes. This works for the 2.7 version of operahotlist2html and might be different for earlier versions. Author says this one also works on Opera 7. HTH someone else that wants to do the same.

 

Thanks for the point in the right direction Cannonfodder. One of these days I'll be able to do it aru's way! :)

Link to comment
Share on other sites

Guest johnKFT

I have just discovered this too, having recently gone to Opera 7 and discovered that the 'export bookmarks to html' facility produces an html file that is a bit different from the Netscape bookmark layout - Mozilla Firebird can only see the first couple of bookmarks. So on a recommendation I tried opera2html. It worked much better but scrambled a few bits, javascript bookmarks especially. Anyone else come across this problem?

Link to comment
Share on other sites

That might be why the script author put the warning into the mix when you use the -m option to make a Mozilla bookmark readable file. Maybe the Firebird needs html 4.01 version which this script breaks?

 

I had same experience as you did. Opera exports bookmarks to html, but Mozilla cannot read them except for the first few. Think it is due to the spaces and indentation Opera uses.

 

Seems it worked ok on my 6.12 version bookmark conversion, but I have over 100 bookmarks so haven't checked each one. :)

 

Guess I could have tried the Konqueror route and imported Opera bookmarks then exported to Mozilla format. Wonder how that works? Anyone tried it?

Link to comment
Share on other sites

  • 2 months later...
Guess I could have tried the Konqueror route and imported Opera bookmarks then exported to Mozilla format.  Wonder how that works?  Anyone tried it?

 

I've tried it and it works. I have tons of bookmarks nested in lots of folders and it seems to work fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...