Skip to content

Instantly share code, notes, and snippets.

@Eskuero
Created December 18, 2017 17:16
Show Gist options
  • Save Eskuero/646b043cf67298e9cd55f0de5115fcf9 to your computer and use it in GitHub Desktop.
Save Eskuero/646b043cf67298e9cd55f0de5115fcf9 to your computer and use it in GitHub Desktop.
Retrieve all retweets loaded on your profile page and undo them at once
var rts = document.getElementsByClassName("tweet-context with-icn");
for (i = 0; i < rts.length; i++) {
var children = rts[i].parentElement.parentElement.children[1].childElementCount;
for (j = 0; j < children; j++) {
var clase = rts[i].parentElement.parentElement.children[1].children[j].className;
if (clase == "stream-item-footer") {
rts[i].parentElement.parentElement.children[1].children[j].children[1].children[1].children[1].click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment