LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-06-2010, 01:22 AM   #1
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Question How to print listing of Firefox bookmarks?


Hi fellow linux users;

Many years ago I was able to print a listing of bookmarks in Mozilla browser. I would like to do that again.

The problem is that I'm now using Firefox 3.6.12 and can't find anything in the menus to allow this. I've tried cut and paste from the organize bookmarks view but it doesn't work very well, loosing formatting.

Can anyone suggest a method to obtain a printed listing?

Thanks, Tom
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-06-2010, 01:38 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,496

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You can export the bookmarks as a html file and then print the file
Quote:
bookmarks => organize bookmarks => import and backup => export
Kind regards
 
Old 12-06-2010, 01:38 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
How about:

Bookmarks->Organize bookmarks...->Import and Backup...->Backup...

Save the file with the desired name. The extension will be .json which you can read in a human readable format here: http://jsonformat.com/#jsondataurllabel

OR

Bookmarks->Organize bookmarks...->Import and Backup...->Export HTML...

Save the file with you desired name and it results in something like the attached image:
Attached Images
File Type: png bookmarks.png (130.9 KB, 10 views)
 
1 members found this post helpful.
Old 12-06-2010, 01:43 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
There is a solution in the mozilla forums: http://support.mozilla.com/en-US/questions/748417. Basically you have to export bookmarks as HTML, open the file and then execute a javascript from the address bar:
Code:
javascript:(function(){var d=document,sS='a[href^="http://"]:after, a[href^="https://"]:after {content:"< " attr(href) " >";padding:0 0 0 1em;} a[href] {text-decoration:none;}',nS=d.createElement('STYLE');nS.setAttribute('type','text/css');nS.innerHTML=unescape(sS);d.getElementsByTagName('head')[0].appendChild(nS);})();
this will put http addresses near the bookmark names, the you can print the page. You can also apply your own parsing command from a terminal and extract the information you want to print, organizing them at your pleasure. Hope this helps.
 
3 members found this post helpful.
Old 12-06-2010, 01:57 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
colucix,

I just tried out your way, and it worked superbly, the screen shot attached:
Attached Images
File Type: png bookmarks1.png (179.7 KB, 25 views)
 
Old 12-07-2010, 02:01 AM   #6
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Original Poster
Rep: Reputation: 34
Gentlemen/ladies, thanks for the replies. From the descriptions they should do what I want. I'll give them a try tomorrow.

Thanks again, Tom
 
Old 12-07-2010, 06:41 AM   #7
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,373

Rep: Reputation: 164Reputation: 164
colucix,

Worked great for me too, thanks!
 
Old 01-20-2011, 12:02 AM   #8
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
But I am not able to "copy" the link addresses from there Any advises?
 
Old 01-20-2011, 01:25 AM   #9
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Strange, it works for me. I have the usual "Copy link location" in the right-click menu and I can copy and paste in the URL bar where only the address will appear. Do the entries in the transformed page look like normal URLs?
 
Old 01-20-2011, 01:44 AM   #10
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
I open that html file in the firefox, press Ctrl - A to select all, press ctrl - c to copy, and ctrl - v to paste and then this is what I get
Code:
Bookmarks Menu

Recently Bookmarked
Recent Tags
bits

5.5 Packing and Unpacking Bit Strings
array of bits - C / C++ answers
comp.lang.c Frequently Asked Questions
Cprogramming.com - Tutorials - Bitwise Operators and Bit Manipulations in C and C++
C syntax - Wikipedia, the free encyclopedia
Handel-C Forum - How do i specify an array of bits ??
How to do bit packing in c++? - Yahoo! Answers
Packing Bits with Bit Fields
unsigned char into array of bits - C

FLTK

#defines
Examples
Fl_JPG_Image() linking path
    Fl_JPG_Image() needs const char* FLTK Forum 
Function Reference
Man
.........
Attached Images
File Type: png bookmarks.png (174.3 KB, 6 views)
 
Old 01-20-2011, 03:53 AM   #11
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Now I can see what the problem really is. Indeed the URLs cannot be selected at all. They don't appear as text objects but I cannot explain why. As I mentioned earlier, I retrieved the solution from the Mozilla support forum, but I'm not a javascript expert.

Anyway, I can offer a workaround to print bookmarks in a similar format, without the brief descriptions that appear for some links. Here is an awk code that will print the title and the URL embedded in <> as shown by the java script. The section names of the bookmarks list will be printed out, as well:
Code:
awk '
/<H[0-9]/ {
  print gensub(/.*<H[0-9].*>(.+)<\/H[0-9]>.*/,"\\1","g")
}

/HREF=/ && /https*:\/\// {
  print gensub(/.*<A HREF="([^ ]+)".*>(.+)<\/A>.*/,"\\2  <\\1>","g")
}

/^$/' bookmarks.html > bookmarks_with_urls
This does not solve the issue, but can be useful to copy/paste the complete URLs. Hopefully.
 
Old 01-20-2011, 09:24 PM   #12
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Thank you for that script, but could you tell me too how to run it? i.e.
like this?
Code:
awk 'scriptName' bookmarks.html
 
Old 01-20-2011, 09:33 PM   #13
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
I ran it that way and then opened bookmarks.html and selected, copied and pasted here:
Did I miss some point here? and I can't see the file bookmarks_with_urls anywhere!
Code:
5.5 Packing and Unpacking Bit Strings
array of bits - C / C++ answers
comp.lang.c Frequently Asked Questions
Cprogramming.com - Tutorials - Bitwise Operators and Bit Manipulations in C and C++
C syntax - Wikipedia, the free encyclopedia
Handel-C Forum - How do i specify an array of bits ??
How to do bit packing in c++? - Yahoo! Answers
Packing Bits with Bit Fields
unsigned char into array of bits - C
 
Old 01-21-2011, 01:13 AM   #14
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Ehm... sorry Anisha but I already put the awk command in my example. It is a complete command line, not a script. The script is simply
Code:
/<H[0-9]/ {
  print gensub(/.*<H[0-9].*>(.+)<\/H[0-9]>.*/,"\\1","g")
}

/HREF=/ && /https*:\/\// {
  print gensub(/.*<A HREF="([^ ]+)".*>(.+)<\/A>.*/,"\\2  <\\1>","g")
}

/^$/
to be run as
Code:
awk -f scriptname bookmarks.html > bookmarks_with_urls
 
Old 01-21-2011, 01:22 AM   #15
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,619
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Code:
anisha@linux-uitj:~> cd Desktop/
anisha@linux-uitj:~/Desktop> awk '
> /<H[0-9]/ {                     
>   print gensub(/.*<H[0-9].*>(.+)<\/H[0-9]>.*/,"\\1","g")
> }                                                       
>                                                         
> /HREF=/ && /https*:\/\// {
>   print gensub(/.*<A HREF="([^ ]+)".*>(.+)<\/A>.*/,"\\2  <\\1>","g")
> }
>
> /^$/' bookmarks.html > bookmarks_with_urls
anisha@linux-uitj:~/Desktop> ls
....
bookmarks.html
bookmarks_with_urls 
...
anisha@linux-uitj:~/Desktop> file bookmarks_with_urls
bookmarks_with_urls: very short file (no magic)

anisha@linux-uitj:~/Desktop>
 
  


Reply

Tags
bookmarks, firefox, printing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox bookmarks.html not showing correct bookmarks even though file is identical. php Ubuntu 7 11-08-2008 04:12 PM
firefox bookmarks.... alaios Linux - Software 2 08-17-2005 11:09 PM
Firefox bookmarks, where are they?? grovesj2 Linux - Newbie 3 08-14-2005 04:39 PM
Firefox 1.0 Bookmarks djabbot Linux - Software 8 01-09-2005 03:53 PM
print listing of directory harnadem Linux - Newbie 2 04-25-2004 09:35 PM


All times are GMT -5. The time now is 04:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration