ScrapbookSync – i.e. how to merge/synchronize two scrapbooks?

(only an idea, for the time being)

Scrapbook is a Firefox extension which adds a “super-bookmark” function to the browser, as it can save the URL of a document together with the document itself. You can organize data in folders and sub-folders as you do with bookmarks.

Suppose you use a computer at home and a notebook when you are away, and you’d like to have the same scrapbook data on both the machines. Once you add a new document to the scrapbook on the notebook, the two scrapbooks are no more in sync.

Scrapbook doesn’t yet offer a simple and quick way to synchronize data: as far as I know, to keep two scrapbooks in sync you need to
1) export data from the first one
2) re-import them into the second one
It is possible to import data directly from a Scrapbook data dir without previous export, but the original folder structure is lost (the items are inserted at root level)

I’m looking for a method to synchronize the data and the folder structure automatically (or semi-automatically).
For the time being, I read part of the Scrapbook tutorial and digged into Scrapbook’s files.

Scrapbook data structures

Scrapbook allows you to have multiple mutually independent scrapbooks.

Each scrapbook is composed of

– the scrapbook.rdf file, which records the folder structure created using the Scrapbook sidebar

and of two directories

– data, containing the saved data
– backup, containing backups of the scrapbook.rdf file

When you save a document using Scrapbook, it creates an entry in the scrapbook.rdf file and a directory inside the data dir (which I’ll call “document dir”), whose name is based on the current date.
When you move an item in the sidebar, Scrapbook leaves this directory unchanged, and updates the scrapbook.rdf file

Each document dir contains the web page you saved (with all the elements it is composed of) and an index.dat file.

Inside the index.dat file we find some fields, the important ones being for us:

– id, the identifier of the document dir

– folder, the path from the root of the tree to the element, composed of the names of the traversed folders, tab separated, empty if the element is at root level. This field appears only upon export (only in the exported data)

How to synchronize multiple scrapbooks

Given the current Scrapbook data structures, what is needed to semi-automatically synchronize two scrapbooks is to sync the document dirs and the scrapbook.rdf files. The latter operation involves merging the two trees built from the two RDF data in the scrapbook.rdf files and replacing them with the tree resulting from the merge

Thinking about writing a Java application, I looked for some library that could help, and I found the following one: JRDF.

Help and future developments

As I said before, any suggestion about already existing tools or ways to sync multiple scrapbooks is appreciated. I’m publishing this page because I was quite surprised I didn’t find any tool to sync two scrapbooks, because I think many people need it, and I’m still thinking someone will write me saying “hey, it’s there!” :-).
I wrote to the author of Scrapbook asking for existing methods to sync scrapbooks, but received no reply.
If no tool really exists, I’ll try to find the time to implement ScrapbookSync.