Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Support bulk delete saved items in facebook #6

Closed
2ge opened this issue Oct 16, 2020 · 8 comments
Closed

[IDEA] Support bulk delete saved items in facebook #6

2ge opened this issue Oct 16, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@2ge
Copy link

2ge commented Oct 16, 2020

A lot of users are searching how to bulk delete saved items. For example I have 4500+ items in https://www.facebook.com/saved/ and there is no way how I can delete them, except to do it one by one. I think with small change of your great program you could save me another few hours of work...and not only me.

@bouiboui
Copy link
Owner

bouiboui commented Jan 4, 2021

Thanks for your suggestion, and sorry for the delay!

That's a nice idea, I use a bit of code magic* to do it myself, I can definitely add it to the extension, I just need to think about the UI / UX (what it should look like for the user, I don't think it should be fully automatic). If you have suggestions I'm all ears.

*Basically, I'm searching for elements with "Unsave" as text and click on them automatically.

@bouiboui bouiboui added the enhancement New feature or request label Jan 4, 2021
@akryvtsun
Copy link

I definitely need all Facebook items delete too! Pls, add this to your code.

@akryvtsun
Copy link

@bouiboui could you share here your magic to delete all FB items? I have around 2k saved items and physically can't delete all of them manually :(

@bouiboui
Copy link
Owner

bouiboui commented Jan 7, 2021

I have Facebook's new design now, old version was easier but I don't remember it.

It takes several steps:

Warning: All the items displayed on the page will be unsaved, permanently.

  • Scroll down to display all the links you want to unsave
  • Run this in your console to open the contextual menu on each item:
Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1).map(e => e.click())
  • Run this to click on "Unsave" on each of them:
Array.from(document.querySelectorAll('[role=menuitem]')).map(e => e.click())

Warning: All the items displayed on the page will be unsaved, permanently.

@akryvtsun
Copy link

@bouiboui I've just shocked: can remove ~2k saved items no longer than 20 min with you help! Thank you so much!
I'm going to integrate you solution in your plugin. Will try to create PR for your code...

@bouiboui
Copy link
Owner

That's nice, you can ask me anything if you need help.

@gianchub
Copy link

I have Facebook's new design now, old version was easier but I don't remember it.

It takes several steps:

Warning: All the items displayed on the page will be unsaved, permanently.

  • Scroll down to display all the links you want to unsave
  • Run this in your console to open the contextual menu on each item:
Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1).map(e => e.click())
  • Run this to click on "Unsave" on each of them:
Array.from(document.querySelectorAll('[role=menuitem]')).map(e => e.click())

Warning: All the items displayed on the page will be unsaved, permanently.

Sooo cool! Thank you for this!

@2ge
Copy link
Author

2ge commented May 18, 2022

facebook is blocking too fast requests, I am no JS master, but this works for me:

// 1) click links to see UNSAVE function
var links = Array.from(document.querySelector('[role=main]').querySelectorAll('[aria-label="More"]')).slice(1)

// Returns a Promise that resolves after "ms" Milliseconds
const timer = ms => new Promise(res => setTimeout(res, ms))

async function load () { // We need to wrap the loop into an async function for this to work
  for (var i = 0; i < links.length; i++) {
    console.log(links[i]);
    links[i].click();
    await timer(1100); // then the created Promise can be awaited
  }
}
load();


//2) click on UNSAVE function
var links = Array.from(document.querySelectorAll('[role=menuitem]'))

// Returns a Promise that resolves after "ms" Milliseconds
const timer = ms => new Promise(res => setTimeout(res, ms))

async function load () { // We need to wrap the loop into an async function for this to work
  for (var i = 0; i < links.length; i++) {
    console.log(links[i]);
    links[i].click();
    await timer(1100); // then the created Promise can be awaited
  }
}

load();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants