Skip to content

Instantly share code, notes, and snippets.

@davidgarsan
Last active May 11, 2018 14:59
Show Gist options
  • Save davidgarsan/92f5fcefcf290d4674e5beb9ae7e0990 to your computer and use it in GitHub Desktop.
Save davidgarsan/92f5fcefcf290d4674e5beb9ae7e0990 to your computer and use it in GitHub Desktop.
javascript:(function() {
function textNodesUnder(el){ var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false); while(n=walk.nextNode()) a.push(n); return a; }
Array.prototype.forEach.call(textNodesUnder(document.body), function(elem){
const t = elem.textContent.trim();
if(t) {
fetch("https://ninini-cvyphndqrn.now.sh/ninini/"+t)
.then(resp => resp.text())
.then(text => elem.textContent = text) } });
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment