Last active
December 28, 2015 23:59
-
-
Save leshikus/7583214 to your computer and use it in GitHub Desktop.
Check Google search results for a particular one
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
function waitFor(f) { | |
setTimeout(function() { | |
try { | |
f(); | |
} catch (e) { | |
console.log('waitFor(): ' + e); | |
waitFor(f); | |
} | |
}, 5000); | |
} | |
l = document.getElementsByClassName('r'); | |
for (i = l.length; i > 0;) { | |
var url = l[--i].firstChild.getAttribute('href'); | |
var w = window.open(url); | |
waitFor(function() { | |
// if (w.document.innerHTML.indexOf('<article') > 0) console.log(url); | |
console.log(w.location.href); | |
w.close(); | |
}); | |
break; | |
} | |
// function waitFor(f) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment