0

I want to clean up my bookmark folders by getting rid of duplicated/links. i have created a program which will import 2 text files which contains a URL like this

File 1:

http://www.google/com
http://anime.stackexchange.com/
https://www.fanfiction.net/guidelines/
https://www.fanfiction.net/anime/Magical-Girl-Lyrical-Nanoha/?&srt=1&g1=2&lan=1&r=103&s=2

File 2:

http://scifi.stackexchange.com/
http://scifi.stackexchange.com/questions/56142/why-didnt-dumbledore-just-hunt-voldemort-down
http://anime.stackexchange.com/
http://scifi.stackexchange.com/questions/5650/how-can-the-doctor-be-poisoned

the program compares the 2 lists and creates a single master list with duplicate URLs removed.

Now i have a few Backup bookmark folders in Firefox which on occasion i'll bookmark all tabs into a new folder with the date of the backup before i close off tabs or do reset my PC. each folder can have between 1000-2000 bookmarks, sometimes there are a bunch of pages which keep getting bookmarked, ie, i have ~50 pages on the Magical Girl Lyrical Nanoha Wiki on different spells, character and terminology which i commonly look back on.

I'd like to know how i can export a bookmark folder so i have a list of URLs similar to what i use in my program

2

The best way I can think of is to use the export function which will export your bookmarks to a html file and then use grep to extract the urls to a text file.

You could try something like ...

find * -exec cat {} \; | grep http | grep -shoP 'http.*?[" >]' > output.txt

Which would search all files in the directory & output to a txt file or

cat bookmark.html | grep http | grep -shoP 'http.*?[" >]' > output.txt

Which would search a specific file (in this case bookmark.html) for urls & then output to a txt file.

But there are many other ways to go about achieving what you want this is just one example.

  • my bad, is this solution for Unix? cause i'm using windows (have edited my question with the tag) – Memor-X Jun 13 '14 at 2:32
  • 1
    For windows there is a simple program called urlextactor which can dump urls from html to txt or clipboard. focalmedia.net/urlextract.html – Rob Jun 13 '14 at 3:00
  • I've just tried the program and it works well you can use ctrl to select multiple html files to extract from at once which should for your bookmark folders. – Rob Jun 13 '14 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.