GithubHelp home page GithubHelp logo

fb-delete's Introduction

Inspiration

Description

First: backup your Facebook data: https://www.facebook.com/help/131112897028467 (recommended, just in case)

Then: You will be prompted for your username, password, the categories of content you'd like to delete, and the year you'd like to delete. A Chrome window will then open to the basic mobile version of Facebook, log you in, navigate to your Activity Log, and start deleting by category and year. You may have to run multiple times to get everything.

None of your data (username, password, or anything else) is sent to me or anywhere other than Facebook's servers. It does not install a browser plugin. This is your computer talking to facebook.com by way of a Node script/Puppeteer. Puppeteer is a Node package developed by Google's Chrome team and allows you to drive a Chrome window programmatically.

SEE WARNINGS IN DISCLAIMER SECTION BELOW

Setup and Use

  • Set your Facebook to use English (US)
  • Install Node.js/NPM: https://nodejs.org/en/download/
  • Download or clone this repo (then unzip to a folder if downloading: https://github.com/spieglt/fb-delete/archive/master.zip)
  • Open your terminal or command prompt or Powershell and navigate to the fb-delete folder
  • Run npm install to install dependencies, wait for it to finish
  • Run npm start, and follow the prompts*
    • The script supports loading FB credentials from a file. To do this copy the sample file cp .env.sample .env and fill it out.

*At the category prompt, use the space bar to select/deselect categories, the up and down arrows to move between them, and the Enter key to proceed. a selects all categories (DANGEROUS! WILL UNFRIEND PEOPLE, DELETE PHOTOS, ETC.), and i inverts the current selection. Same goes for years selection. Navigate to your Activity Log on facebook.com as you normally would, click "Filters", and select a category if you'd like to see the kind of content that will be deleted.

Planned features

  • Output log file
  • Error handling

Also strongly recommended: https://blog.mozilla.org/firefox/facebook-container-extension/

Disclaimer

I accept no responsibility if this program deletes anything you don't want deleted! If this is a concern, do not use this program! All deletions are final!

IF YOU SELECT THE CATEGORY "Added Friends" FOR 2017, IT WILL UNFRIEND EVERY PERSON YOU BECAME FRIENDS WITH IN 2017!

IF YOU SELECT THE CATEGORY "Photos and Videos" FOR 2008, IT WILL DELETE EVERY PHOTO YOU UPLOADED IN 2008! BEWARE!

This is all still probably pretty flaky. It works on my machine, but please leave feedback in Issues on Github if it doesn't work for you and I'll try to help if I can. Thanks for your interest and please check out https://github.com/spieglt/flyingcarpet!

fb-delete's People

Contributors

anatolebeuzon avatar dependabot[bot] avatar heroprotagonist avatar l3d00m avatar spieglt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fb-delete's Issues

Accept Cookies

Upon running the script as instructed, a chromium windows opens very briefly. Following error is printed in the terminal.

node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^

Error: Error: failed to find element matching selector "input[id=m_login_email]"
at ElementHandle.$eval (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/JSHandle.js:504:13)
at async main (/home/jakob/Downloads/fb-delete/index.js:18:3)
-- ASYNC --
at ElementHandle. (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/helper.js:111:15)
at DOMWorld.$eval (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/DOMWorld.js:156:21)
at async main (/home/jakob/Downloads/fb-delete/index.js:18:3)
-- ASYNC --
at Frame. (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/helper.js:111:15)
at Page.$eval (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/Page.js:345:29)
at Page. (/home/jakob/Downloads/fb-delete/node_modules/puppeteer/lib/helper.js:112:23)
at main (/home/jakob/Downloads/fb-delete/index.js:18:14)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)

After recording the screen for the script execution, it seems that an 'accept cookies' window is what opens. It seems like the chromium browser that's opened is one installed as a dependency.

Re-running the code to delete missed posts

First: amazing code, thank you.

After running it the first time around, it deleted many of my posts but missed a lot as well. When I tried to go back and delete the missed ones, it skips everything and outputs "Done!"

Any ways to work around this?

I'm getting blocked. Request limit settings?

Hi Theron,

So it seems that the deletion intervall is too short, so facebook's algorithm detecting that behaviour and is blocking me, so i am not able for further deletion afterwards.
Please have a look to the attached .png.

blocked

Is there an "easy" way to adjust the deletion interval?

Greetings Markus

Protocol Error

(node:5648) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Invalid parameters url: string value expected
at Promise (C:\Users\Renovatio\fb-delete\node_modules\puppeteer\lib\Connection.js:198:56)
at new Promise ()
at CDPSession.send (C:\Users\Renovatio\fb-delete\node_modules\puppeteer\lib
Connection.js:197:12)
at navigate (C:\Users\Renovatio\fb-delete\node_modules\puppeteer\lib\Page.js:520:39)
at Page.goto (C:\Users\Renovatio\fb-delete\node_modules\puppeteer\lib\Page.js:500:7)
at followLinkByContent (C:\Users\Renovatio\fb-delete\index.js:99:14)
(node:5648) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
id: 1)
(node:5648) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.

Error: Protocol error (Page.navigate): Invalid parameters url: string value expected

Hello - I try and just do the following and I get this error. Chromium stays open and stuck at:

https://mbasic.facebook.com/[PROFILE_USERNAME]?ref_component=mbasic_home_header&ref_page=%2Fwap%2Fhome.php&refid=8

? Please enter your Facebook password: *****************
? Select the categories you'd like to delete: Posts
? Select the years you'd like to delete: 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2
005, 2004
(node:15252) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Invalid parameters url: string value expected
    at C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\Connection.js:183:56
    at new Promise (<anonymous>)
    at CDPSession.send (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\Connection.js:182:12)
    at navigate (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\FrameManager.js:118:39)
    at FrameManager.navigateFrame (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\FrameManager.js:95:7)
    at Frame.goto (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\FrameManager.js:406:37)
    at Frame.<anonymous> (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\helper.js:112:23)
    at Page.goto (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\Page.js:674:49)
    at Page.<anonymous> (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\helper.js:112:23)
    at followLinkByContent (C:\Users\jack\Downloads\fb-delete\index.js:101:14)
  -- ASYNC --
    at Frame.<anonymous> (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\helper.js:111:15)
    at Page.goto (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\Page.js:674:49)
    at Page.<anonymous> (C:\Users\jack\Downloads\fb-delete\node_modules\puppeteer\lib\helper.js:112:23)
    at followLinkByContent (C:\Users\jack\Downloads\fb-delete\index.js:101:14)
    at async next (C:\Users\jack\Downloads\fb-delete\index.js:30:3)
    at async main (C:\Users\jack\Downloads\fb-delete\index.js:25:3)
(node:15252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error Node:4824

(node:4824) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)       
(node:4824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.  

Facebook Warning - Too Fast Too Furious

image

Can the presence of this warning be checked for to temporarily pause execution when it happens? I'm not sure how long the waiting period needs to be though.

Current Year Error

Thanks for this: was looking for a way to remove past content easily instead of just hiding or setting to 'Friends'.

I figured I'd take it the whole way and remove 2018 content as well, but it errors out

Year 2018 not found. { Error: Protocol error (Page.navigate): Invalid parameters url: string value expected
    at Promise (E:\fb-delete\node_modules\puppeteer\lib\Connection.js:198:56)
    at new Promise (<anonymous>)
    at CDPSession.send (E:\fb-delete\node_modules\puppeteer\lib\Connection.js:197:12)
    at navigate (E:\fb-delete\node_modules\puppeteer\lib\Page.js:520:39)
    at Page.goto (E:\fb-delete\node_modules\puppeteer\lib\Page.js:500:7)
    at followLinkByContent (E:\fb-delete\index.js:99:14)
    at <anonymous>
  message: 'Protocol error (Page.navigate): Invalid parameters url: string value expected' }

Figured I'd post about it before digging too far into it.

No matter what option I chose nothing works.

(node:6988) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Invalid parameters url: string value expected
    at Promise (c:\Users\Trent\Desktop\fb-delete-master\node_modules\puppeteer\lib\Connection.js:198:56)
    at new Promise (<anonymous>)
    at CDPSession.send (c:\Users\Trent\Desktop\fb-delete-master\node_modules\puppeteer\lib\Connection.js:197:12)
    at navigate (c:\Users\Trent\Desktop\fb-delete-master\node_modules\puppeteer\lib\Page.js:520:39)
    at Page.goto (c:\Users\Trent\Desktop\fb-delete-master\node_modules\puppeteer\lib\Page.js:500:7)
    at followLinkByContent (c:\Users\Trent\Desktop\fb-delete-master\index.js:99:14)
    at <anonymous>
(node:6988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6988) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

That's the error message I get, it loads chronium, logs in fine then goes from my timeline to my profile and crashes... Any fixes?

UnhandledPromiseRejectionWarning

Hello,

First of all, thanks very much for the repo ! If it were to work on my machine it would be lovely.
I am not used to using javascript whatsover thus I have no idea how to debug this : when trying to run your script everything seems to work fine until chromium opens :
the log-ins are correctly written and should therefore allow the bot to connect itself. However, the bot validates my logins I then get the following error

(node:13088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13088) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any idea what could cause such error to happen ?

Thanks anyway !

error

Error: Error: failed to find element matching selector "input[id=m_login_email]"
at ElementHandle.$eval (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\JSHandle.js:504:13)
at async main (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\index.js:18:3)
-- ASYNC --
at ElementHandle. (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\helper.js:111:15)
at DOMWorld.$eval (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\DOMWorld.js:156:21)
at async main (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\index.js:18:3)
-- ASYNC --
at Frame. (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\helper.js:111:15)
at Page.$eval (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\Page.js:345:29)
at Page. (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\node_modules\puppeteer\lib\helper.js:112:23)
at main (C:\Users\Mr.Fox\Downloads\Compressed\fb-delete-master\fb-delete-master\index.js:18:14)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7)

After entering the user name and password ( double checked for correctness, clipboard correctness as well), I get the error( exception)

(node:1465) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!

(chrome:1475): Gtk-WARNING **: 13:29:45.860: cannot open display:


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/trou                                          bleshooting.md

    at onClose (/home/..[someLocation]/Launcher.js:255:14)
    at Interface.helper.addEventListener (/home/k/Downloads/fb-delete-master/nod                                          e_modules/puppeteer/lib/Launcher.js:244:50)
    at emitNone (events.js:111:20)
    at Interface.emit (events.js:208:7)
    at Interface.close (readline.js:370:8)
    at Socket.onend (readline.js:149:10)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
(node:1465) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This                                           error originated either by throwing inside of an async function without a catch                                           block, or by rejecting a promise which was not handled with .catch(). (rejection                                           id: 1)
(node:1465) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre                                          cated. In the future, promise rejections that are not handled will terminate the                                           Node.js process with a non-zero exit code.

TypeError

(node:18746) UnhandledPromiseRejectionWarning: TypeError: puppeteer.launch is not a function
at main (/Users/[ ]/Documents/GitHub/fb-delete/index.js:11:35)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18746) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18746) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.