Created
September 11, 2019 15:11
-
-
Save sajjadmd/48d9c744cb20cb8380e50a08d2cf1ae4 to your computer and use it in GitHub Desktop.
SEO script, extract SERP bold keywords.
This file contains hidden or 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() { | |
| clear(); | |
| const words = []; | |
| function uniq(value, index, self) { | |
| return self.indexOf(value) === index; | |
| } | |
| let selector = `#search em`; | |
| const found = document.querySelectorAll(selector); | |
| if (found.length > 0) { | |
| found.forEach((f) => { | |
| let text = f.textContent; | |
| if (text) { | |
| words.push(text); | |
| } | |
| }); | |
| } | |
| console.log("%cLOWER CASE", "font-size:14px;font-weight:bold"); | |
| console.log(words.map(v => v.toLowerCase()).filter(uniq).join("\n")); | |
| console.log("%cALL", "font-size:14px;font-weight:bold;"); | |
| console.log(words.filter(uniq).join("\n")); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment