Skip to content

Instantly share code, notes, and snippets.

@christianbundy
Created April 29, 2015 04:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save christianbundy/013f409f9a246dc9a9cd to your computer and use it in GitHub Desktop.
Save christianbundy/013f409f9a246dc9a9cd to your computer and use it in GitHub Desktop.
Probably automatically gets you into Google Foobar. Probably.
// to be run on https://docs.python.org/3.5/reference/
// (probably works on other versions of the docs) (probably)
var topics = [];
var links = document.getElementsByTagName("a");
for (var i in links) {
if (links.hasOwnProperty(i)) {
var link = links[i];
var text = link.innerText;
if (typeof text === 'string') {
var matches = text.match(/\d+\.\d+\. (The )?(.+)/);
if (matches !== null) {
topics.push('python ' + matches[2].toLowerCase());
}
}
}
}
setInterval(function () {
var encoded = encodeURIComponent(topics[0]);
var url = 'https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=' + encoded;
var a = document.createElement("a");
a.target = "_blank";
a.href = url;
a.click();
topics.shift();
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment