Created
January 12, 2017 20:10
-
-
Save Glench/3120fce73ab6deb9a90a59070f6bc30e to your computer and use it in GitHub Desktop.
Add wikipedia links to search results on Nutrimatic
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
document.querySelectorAll('span').forEach(function(span){ | |
var term = span.innerText; | |
var url = 'https://en.wikipedia.org/w/index.php?title=Special:Search&search='+ term.replace(/\s/g,'+') | |
span.innerHTML = '<a target="_blank" href="'+ url +'">'+ term +'</a>' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment