8 moz_bookmarks - Read Mozilla bookmarks database and display titles and URLs line-by-line
25 cd ~
/.moonchild\ productions
/pale\ moon
/
30 sqlite3
-list "$dbfile" "SELECT 'bookmark', id, parent, fk, title FROM moz_bookmarks;
31 SELECT 'place', NULL, NULL, id, url FROM moz_places;
32 SELECT 'feed', item_id, NULL, NULL, content FROM moz_items_annos WHERE anno_attribute_id=(SELECT id FROM moz_anno_attributes WHERE name='livemark/feedURI')" |\
40 while read -r type bookmark_id parent_id place_id content
44 place_ids
[$bookmark_id]=$place_id
45 parent_ids
[$bookmark_id]=$parent_id
46 titles
[$bookmark_id]=$content
49 urls
[$place_id]=$content
52 bm_urls
[$bookmark_id]=$content
65 for bookmark_id
in "${!parent_ids[@]}"
67 if [ ${parent_ids[$bookmark_id]} = $parent_id ]
69 title
=${titles[$bookmark_id]}
70 echo "${title:-(no title)}"
73 url
=${bm_urls[$bookmark_id]}
77 place_id
=${place_ids[$bookmark_id]}
78 if [ "$place_id" != NULL
]
80 url
=${urls[$place_id]}
88 show_bookmarks
$bookmark_id | indent
96 show_bookmarks
$parent_id