Google Bookmarks Total Count

By Umakanthan Chandran Last update Jan 29, 2009 — Installed 79 times. Daily Installs: 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0

There are 2 previous versions of this script.

// ==UserScript==
// @name           Google Bookmarks Total Count
// @namespace      Umakanthan Chandran(cumakt@gmail.com);
// @description    Shows the Total count of bookmarks for Google Bookmarks
// @include        http://*.google.*/bookmarks/*
// ==/UserScript==

var totalCount = 0;
var counter = 0 ;
var urlId = "lbl_m_"+counter+"_el"; 

while(document.getElementById(urlId)) {
totalCount = totalCount + parseInt(document.getElementById(urlId).firstChild.innerHTML.replace(")","").replace("(",""),10);
counter++;
urlId = "lbl_m_"+counter+"_el";
}

if(document.getElementById('lbl_c_0')) {
    actualNode =  document.getElementById('lbl_c_0').previousSibling;
    markup = actualNode.firstChild.innerHTML;
    actualNode.firstChild.innerHTML = markup+" (" + totalCount + ")";
}