Last active
December 17, 2022 18:21
-
-
Save johnrees/0d4098f748ef0be40e08cfef1950ad42 to your computer and use it in GitHub Desktop.
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
// go to following or followers page | |
let values = new Set([]); | |
let height = 0; | |
function scroll() { | |
if (height < document.body.scrollHeight) { | |
height = document.body.scrollHeight; | |
window.scrollTo(0, height); | |
setTimeout(scroll, 2000); | |
[ | |
...document.querySelectorAll( | |
"[aria-label^='Timeline: Follow'] a>div>div.css-1hf3ou5>span" | |
), | |
].forEach(({ innerText }) => { | |
values.add(innerText.replace("@", "")); | |
}); | |
} else { | |
const result = [...values].join("\n"); | |
console.log(result); | |
// const popup = window.open("about:blank", "", "_blank"); | |
// popup.document.write(`<pre>${result}</pre>`); | |
} | |
} | |
scroll(); |
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
// go to likes or bookmarks page | |
let values = new Set([]); | |
let height = 0; | |
function scroll() { | |
if (height < document.body.scrollHeight) { | |
height = document.body.scrollHeight; | |
window.scrollTo(0, height); | |
setTimeout(scroll, 2000); | |
[ | |
...document.querySelectorAll( | |
`[aria-label$='${ | |
document.title.includes("liked by") ? "liked Tweets" : "Bookmarks" | |
}'] a:has(time)` | |
), | |
].forEach(({ href }) => { | |
values.add(href); | |
}); | |
} else { | |
const result = [...values].join("\n"); | |
console.log(result); | |
} | |
} | |
scroll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
paste
copy([...values].join("\n"))
in a separate command afterwards if you want them on your clipboard