Skip to content

Instantly share code, notes, and snippets.

@alanszlosek
Created November 21, 2015 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanszlosek/325aaa1c4344c0ac81c8 to your computer and use it in GitHub Desktop.
Save alanszlosek/325aaa1c4344c0ac81c8 to your computer and use it in GitHub Desktop.
Crawl Google Keep entries, concatenate them all, and print to the console. Right click on the console entry to save as a single file.
/*
Inspect your google keep items and find the appropriate container selector, and those for the title and item body divs.
*/
var items=document.querySelectorAll('.IZ65Hb-n0tgWb.IZ65Hb-WsjYwc-nUpftc.RNfche');
var out = '';
for(var i = 0; i < items.length; i++) {
var item = items[i];
var text = item.querySelector('.IZ65Hb-YPqjbf.r4nke-YPqjbf[contenteditable="false"]');
if(text && text.innerText.length > 0) {
out += text.innerText + "\n\n";
}
text = item.querySelector('.IZ65Hb-YPqjbf.h1U9Be-YPqjbf[contenteditable="false"]');
if (text) {
out += text.innerText + "\n\n----\n\n";
}
}
console.log(out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment