Skip to content

Instantly share code, notes, and snippets.

@mclarke47
Last active December 20, 2023 01:45
Show Gist options
  • Save mclarke47/ff0456babf8f799f8053 to your computer and use it in GitHub Desktop.
Save mclarke47/ff0456babf8f799f8053 to your computer and use it in GitHub Desktop.
a complete hack to click the unsave buttons on all reddit posts on screen.
Doesn't seem to work anymore
$("a").filter(function(index){return $(this).text()==="unsave"}).click();
New
document.querySelectorAll("a").forEach(function(index,other){if(index.text==="unsave"){index.click();}});
@mclarke47
Copy link
Author

Nice one 👍

@sanmadjack
Copy link

Times are a-changin again. This works on the current modern Reddit ui:

document.querySelectorAll("button[role='menuitem']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);

@Sealjay
Copy link

Sealjay commented Jan 20, 2020

I used this most recently:

document.querySelectorAll("span[class='_2-cXnP74241WI7fpcpfPmg']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);

@Sealjay
Copy link

Sealjay commented Jan 20, 2020

I used this most recently:

document.querySelectorAll("span[class='_2-cXnP74241WI7fpcpfPmg']").forEach(function(index,other){if(index.textContent==="unsave"){index.click();}});window.location.reload(true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment