Option to import bookmark folders as tags
There is no standard way of export tags in Netscape's bookmarks file format. When exporting from Google Bookmarks, folders are used as tags. The following example shows a bookmark that was tagged with History and Programming:
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1258826211990949">History</H3>
<DL><p>
<DT><A HREF="http://dotnetmasters.com/historyofcfamily.htm" ADD_DATE="1260914469588170">History of the C family of languages</A>
</DL><p>
<DT><H3 ADD_DATE="1238826211990949">Programming</H3>
<DL><p>
<DT><A HREF="http://dotnetmasters.com/historyofcfamily.htm" ADD_DATE="1260914469588170">History of the C family of languages</A>
</DL><p>
</DL><p>
In order to support imports from Google Bookmarks (and other services which use folders during the export), I added an option to the import form which uses the folders as tags. For bookmarks with multiple tags the overwrite options needs to be enabled as well. Additionally, the timestamp needs to be adjusted from microseconds to normal unix seconds during the import.

The result of a successful import has the right tags for all imported links:

I have the same feature available in my proposal of importing files from firefox JSON export. So, when the pull request will be accepted, I'll enable this feature for JSON import also.
@sijnak That's great! Having a JSON import makes it a lot easier for people to move to Shaarli from Firefox, etc.
@levjj Great option ! How can I benefit from it ? I would like to import my GBookmarks into shaarli, but the loss of the tags is what prevents me to switch. However I am not at all a PHP developper....
@PatDeLux Until @sebsauvage merges this pull request, you could just clone [this branch](https://github.com/levjj/Shaarli/tree/import-folders-as-tags reposiroty) of Shaarli and import the Google Bookmarks HTML file (be sure to check the "overwrite existing links" option).
@levjj : thanks for replying. Your link "this branch" returns me a 404 error...(sorry to bother you - this Github etc..is 100% new for me - I am mostly developing on SQL Server and VBA)
@PatDeLux Sorry, should have checked the link. Try this one instead.
Christopher, Thanks for your work. I would like to point an issue: I have a lot of GBookmarks tagged "SQL Server", and they generate 2 tags in Shaarli: 1 for *SQL *and 1 for *Server *. So for me there is definitely a problem for tags containing a space ! Regards,
Patrick Honorez +352 691-67 68-65
On 26 June 2013 23:06, Christopher S. [email protected] wrote:
@PatDeLux https://github.com/PatDeLux Sorry, should have checked the link. Try this onehttps://github.com/levjj/Shaarli/tree/import-folders-as-tagsinstead.
— Reply to this email directly or view it on GitHubhttps://github.com/sebsauvage/Shaarli/pull/80#issuecomment-20080064 .
Yep, this is an open issue in Shaarli. See #22
Thanks, I really needed that option.
Priceless !
Shaarli (community fork) now uses a dedicated Netscape bookmark parser:
- parser sources: https://github.com/shaarli/netscape-bookmark-parser
- release notes: https://github.com/shaarli/netscape-bookmark-parser/releases
- addition to Shaarli (in progress): https://github.com/shaarli/Shaarli/issues/607