Skip to content

Instantly share code, notes, and snippets.

@morgan9e
Last active May 22, 2024 09:26
Show Gist options
  • Save morgan9e/d357e126af9e8c566a0b52a069121adf to your computer and use it in GitHub Desktop.
Save morgan9e/d357e126af9e8c566a0b52a069121adf to your computer and use it in GitHub Desktop.
var pathqs = 'path[d="M4.75 3.79l4.603 4.3-1.706 1.82L6 8.38v7.37c0 .97.784 1.75 1.75 1.75H13V20H7.75c-2.347 0-4.25-1.9-4.25-4.25V8.38L1.853 9.91.147 8.09l4.603-4.3zm11.5 2.71H11V4h5.25c2.347 0 4.25 1.9 4.25 4.25v7.37l1.647-1.53 1.706 1.82-4.603 4.3-4.603-4.3 1.706-1.82L18 15.62V8.25c0-.97-.784-1.75-1.75-1.75z"]';
var links = [];
setInterval(() => {
document.querySelectorAll(pathqs)
.forEach(e => {
let div = e.parentNode.parentNode.parentNode;
if(div.classList.contains("r-xoduu5")) {
let postlink = div.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('a.css-146c3p1.r-bcqeeo.r-1ttztb7.r-qvutc0.r-1qd0xha.r-a023e6.r-rjixqe.r-16dba41.r-xoduu5.r-1q142lx.r-1w6e6rj.r-9aw3ui.r-3s2u2q.r-1loqt21').href;
if (postlink) {
console.log(postlink);
links.push(postlink);
div.click();
[...document.getElementsByClassName("css-1jxf684")]
.forEach(e => {
if (e.innerText == "Undo repost") {
e.click();
}
})
}
console.log(links);
}
})
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment