Last active
December 29, 2022 06:26
-
-
Save c9s/d33ac20f39f3f42b20096c84af2a38d3 to your computer and use it in GitHub Desktop.
tweet text aggregator + eth wallet address
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
$$('main')[0].onclick = (e) => { | |
const re = /(0x[a-fA-F0-9]{40})/; | |
const addresses = []; | |
// const d = document.getElementsByTagName('main') | |
const els = document.querySelectorAll('[data-testid="tweetText"]') | |
const className = els[0].className; | |
const tweets = Array.from(document.getElementsByClassName(className)); | |
console.log(`${tweets.length} tweets found`, tweets); | |
tweets.forEach((el) => { | |
const text = el.innerText | |
const matches = re.exec(text); | |
if (matches) { | |
addresses.push(matches[1]); | |
} | |
}); | |
console.log(addresses); | |
const o = addresses.join("\n"); | |
console.log(o); | |
navigator.clipboard.writeText(o); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment