Shaarli icon indicating copy to clipboard operation
Shaarli copied to clipboard

Option to import bookmark folders as tags

Open levjj opened this issue 13 years ago • 11 comments

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.

import

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

result

levjj avatar Apr 21 '13 02:04 levjj

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 avatar Apr 21 '13 17:04 sijnak

@sijnak That's great! Having a JSON import makes it a lot easier for people to move to Shaarli from Firefox, etc.

levjj avatar Apr 21 '13 21:04 levjj

@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....

PatrickHonorez avatar Jun 26 '13 07:06 PatrickHonorez

@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 avatar Jun 26 '13 09:06 levjj

@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)

PatrickHonorez avatar Jun 26 '13 19:06 PatrickHonorez

@PatDeLux Sorry, should have checked the link. Try this one instead.

levjj avatar Jun 26 '13 21:06 levjj

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 .

PatrickHonorez avatar Jul 02 '13 20:07 PatrickHonorez

Yep, this is an open issue in Shaarli. See #22

levjj avatar Jul 03 '13 11:07 levjj

Thanks, I really needed that option.

ghost avatar Jul 07 '13 02:07 ghost

Priceless !

silopolis avatar Aug 20 '13 10:08 silopolis

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

virtualtam avatar Aug 10 '16 08:08 virtualtam