TiddlyWiki as Bookmark Manager

142 views
Skip to first unread message

Joshua Fontany

unread,
Mar 3, 2019, 4:21:34 PM3/3/19
to TiddlyWikiDev
So I have been reading old threads, looking at previous TW Bookmark implementations, and thinking about how I would manage my (frankly huge) bookmark collection with TiddlyWiki.

The problem here seems to be getting them into TW. I'm frankly not going to do that manually, and that seems to be how all previous implementations work.

I thought there might be an API for this, but discovered how hard it is to request your own Chrome bookmarks via an API (literally impossible).

That made me realize that with my JsonMangler plugin, I now have what I need to parse Chrome's Bookmark json file with wikitext scripts.

There are two routs I could go with this, so I thought I'd bounce it off the community here.

1) Drag & Drop - manually drag & drop Chrome's Bookmark file onto Tiddlywiki. A plugin will invoke either `th-importing-tiddler` or `th-importing-file` in order to preprocess their json structure into the appropriate tiddlers, whatever that may look like.

Pros: one-action import function, handling duplicates 'behind the scenes', single file & server

Cons: requires manual action by the user, original Json structure is not retained

2) Tell TW where your Bookmarks live (server only) - setup a json tiddler to tell TW where your Bookmarks live on each device. TW will then load the Bookmarks file(s) as tiddlers, allowing wikitext scripts to parse, break down, and setup individual tiddlers for each data object.

Pros: Should(?) be able to pull updates when you update your browser's bookmarks (or sync) by a button press in the wiki.

Cons: Server only setup, possilbe(?) conflicts when TW server and browser try to write to the same file (can you set an externally loaded file to 'read-only'?), trying to pick up changes to the source file while the server is running (I think this is possible).

The key elements to pull out of Chrome's bookmark Json structure for each Bookmark are:
* name > title? caption?
* url > url? title?
* date_added > created
* id > $browser$_id (useful for re-import operations)
* type > bookmark-type (not familiar with other types, mine all say 'url')

Then there are the Folder objects that we could parse into Tags.

What do you all think?

Best,
Joshua Fontany

TonyM

unread,
Mar 3, 2019, 6:00:39 PM3/3/19
to TiddlyWikiDev
Joshua,

Sounds like a good idea. I am playing with improvements on the url import process, which may be of interest. 

Dragging and dropping from a browser address bar to TW5 results in an import of  tiddler called Untitled N, using import preview we see a json content as follows

{
   
"tiddlers": {
       
"Untitled 7": {
           
"title": "Untitled 7",
           
"text": "https://auspost.com.au/terms-conditions/mypost-account-terms-of-use\nMyPost Account - Terms of Use - Australia Post"
       
}
   
}
}

eg This will create the Untitled 7 tiddler containing 

I am planning to make a view template edition to test for text with a https:// or http:// prefix and present a link icon on the tiddler and in a custom list.

I will also extract the suffix as the caption name, and allow a quick tag or field button to mark it as a url tiddler.

This could also happen with an extension to the import handler, thus identifying all "url only" tiddlers in the import json. If your idea can leverage the same path.


My thoughts, On your identified elements
  • title - the suffix after the last /
  • Caption the bookmark title (if available)
  • I would recommend leaving the created date for when a tiddler is created, and use an alternate field bookmark-date
  • id - sounds useful
  • Type - perhaps a new tiddler type needs to be defined? One that automatically handles the url content similar to my project.
The Folder objects may be better being delimited and placed in another list field eg: bookmark-tags with an option to transfer these into tags, at least this should be configurable.

I would urge you to look at firefoxes exported bookmarks file, as it is similar to chromes, and working with both will be great.

This is yet again something that could be supported by the ability to transfer tiddlers to a single json tiddler and in reverse. Ie I could generate a json tiddler that could be imported/replace chrome / firefox bookmarks. A Bookmarks import could sit un-translated into URL's if desired.

Regards
Tony

Joshua Fontany

unread,
Mar 5, 2019, 5:51:13 PM3/5/19
to TiddlyWikiDev
Odd, I'm not getting that behaviour when I drag a address bar url into a tiddlywiki. I just get the url in the text field. What browser are you using?

Ok, so grabbing the Bookmarks json file from Chrome is trivial, as long as you know where your install path to user data is. I think FireFox is similar.

I've been thinking about how to extract the Favicons from Chrome's internal sqlite DB, and have come up with a solution that will allow import into TW server version easily.

The user would have to download DB Browser for Sqlite, run an SQL script I provide, and manually export 2 new Tables as Json files (not super hard).

This would dump the Blob binaries of the Favicons (my script only saves the largest icon) into a Json that would be very easy to import, and also one for the URL -> Favicon mappings.

I'm sure we could do something similar for FireFox as well.

Once you have the 3 json files, it is then just a matter of drag-drop import, aor setting up a tiddlywiki.files json in your wiki folder to load the new files on re-load.

Then we can process them into individual tiddlers. I agree that a new `text/url` tiddler-type would be very useful for further display templates to show favicon, format for use in lists, etc.

Probably won't have time to really work on this until later in the week, so am still open to suggestions. :)

Best,
Joshua Fontany
Reply all
Reply to author
Forward
0 new messages