I want to manipulate my Firefox bookmarks a bit. I've exported them to a .json file, and read them into my program. Now I'm trying to make sense of the file. I've created a bookmark that looks like this:
The random strings help me find them in the big lump of JSON. The bookmark object looks like this:
{
"title":"49jy5M9NxD4xOQ13d5me",
"id":4080,
"parent":3,
"dateAdded":1384416939464000,
"lastModified":1384416982381000,
"annos":[
{
"name":"bookmarkProperties/description",
"flags":0,
"expires":4,
"value":"description"
}
],
"type":"text/x-moz-place",
"uri":"http://location/",
"keyword":"keyword1,keyword2,keyword3"
},
But the tags aren't present in there...
If I run a search for the tag string, I find it in a completely different section of the file,
{
"index":2,
"title":"Tags",
"id":4,
"parent":1,
"dateAdded":1359252968891000,
"lastModified":1384417276968000,
"type":"text/x-moz-place-container",
"root":"tagsFolder",
"children":[
{
"title":"mEszv3zTk1GHQYfTbsZZ",
"id":4081,
"parent":4,
"dateAdded":1384417272962000,
"lastModified":1384417272962000,
"type":"text/x-moz-place-container",
"children":[
{
"title":null,
"id":4082,
"parent":4081,
"dateAdded":1384417272962000,
"lastModified":1384417272962000,
"type":"text/x-moz-place",
"uri":"http://location/"
}
]
},
{
"index":1,
"title":"QWhcN2Bpl2BBUAtzdkif",
"id":4083,
"parent":4,
"dateAdded":1384417276968000,
"lastModified":1384417276969000,
"type":"text/x-moz-place-container",
"children":[
{
"title":null,
"id":4084,
"parent":4083,
"dateAdded":1384417276969000,
"lastModified":1384417276969000,
"type":"text/x-moz-place",
"uri":"http://location/"
}
]
}
]
},
But there's no discernible link back to the bookmark. None of the IDs line up. So what's the relationship?
Is there a spec on the Firefox bookmark format? I can't find one.
I went through the same process and finally realized that the uri is what links the tag to the bookmark. That's why even when you have a site bookmarked several times and only tag it once, the tags will show up however you visit the site.