Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chris-castillo-dev/169de78458147855c889a9d604a0399b to your computer and use it in GitHub Desktop.
Save chris-castillo-dev/169de78458147855c889a9d604a0399b to your computer and use it in GitHub Desktop.
javascript:!function e(){let t=document.querySelector("main ol");if(t)!function e(t){let o=Array.from(t.querySelectorAll("li")).map(e=>{let t=e.querySelector("span:nth-child(2)").textContent.trim(),o=e.querySelector("span:nth-child(3)").textContent.trim();return{Keyword:t,"Search Volume":o}}),r=o.map(e=>Object.values(e).join(";")).join("\n");navigator.clipboard.writeText("Keyword;Search Volume\n"+r).then(()=>{alert("Keyword and Search Volume data copied to clipboard with headers")}).catch(e=>{alert("Failed to copy data to clipboard:\n"+e)})}(t);else{let o=document.querySelector('iframe[src*="/local/business/"]');if(o){let r=o.getAttribute("src");window.open(r,"_blank")}else alert("Ordered list not found inside main tag and no matching iframe found.")}}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment