Last active
May 10, 2017 19:37
-
-
Save 3rdp/015b2840b9a0b5cfa55858fca9544654 to your computer and use it in GitHub Desktop.
an attempt to auto select multiple notes in google keep. with jquery 1.10.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var regx = /\d+\D\d+\D\d+/; // to find headers like "20/04/2017" | |
var notes_clstr = ".IZ65Hb-n0tgWb.IZ65Hb-WsjYwc-nUpftc"; | |
var header_clstr = ".IZ65Hb-YPqjbf.r4nke-YPqjbf"; | |
var button_select_clstr = ".Q0hgme-LgbsSe.Q0hgme-Bz112c-LgbsSe.IZ65Hb-NGme3c.VIpgJd-LgbsSe"; | |
var button_not_clstr = ".LwH6nd"; | |
$(notes_clstr).each(function() { | |
// 1. check an header | |
var header_text = $(this).find(header_clstr).not(button_not_clstr).text(); | |
if (!regx.test(header_text)) return; | |
console.log(header_text); | |
// 2. find the select button and trigger click | |
var $button_select = $(this).find(button_select_clstr); | |
var button_select_dom = $button_select.get(0); | |
var button_select_queryselector = document.querySelector(button_select_clstr); | |
/* FAIL: click event doesn't trigger on any of above */ | |
console.dir(button_select_queryselector.click()) | |
return false; | |
// ^ stop early (after first match) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment