Skip to content

Instantly share code, notes, and snippets.

@leesei
Created December 18, 2013 03:50
Show Gist options
  • Save leesei/8017014 to your computer and use it in GitHub Desktop.
Save leesei/8017014 to your computer and use it in GitHub Desktop.
#js #snippet google-bookmark-to-json
// first, visit google bookmark and jQuerify it
// convert bookmarks in the current page to json
// (paste to Chrome Dev Tools's Source -> Snippets, "Ctrl+Enter" to run)
function entry2Json(entry) {
return {
title: entry.innerText,
href: entry.href
};
}
bkmklist = $("a[id^='bkmk_href']")
result = [].map.call(bkmklist, entry2Json, null, ' ');
JSON.stringify(result, null, ' ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment