Coder Social home page Coder Social logo

deletefb's Introduction

WARNING: This currently only works for English language Facebook accounts, due to the lack of a usable API. Also, year by year deletion is currently broken. Feel free to fork or make pull requests.

Why?

I needed a simple and reliable way to delete Facebook posts. There are third-party apps that claim to do this, but they all require handing over your credentials, or are unreliable in other ways. Since this uses Selenium, it is more reliable, as it uses your real web browser, and it is less likely Facebook will block or throttle you.

As for why you would want to do this in the first place. That is up to you. Personally I wanted a way to delete most of my content on Facebook without deleting my account.

Will this really delete posts?

I can make no guarantees that Facebook doesn't store the data somewhere forever in cold storage. However this tool is intended more as a way to clean up your online presence and not have to worry about what you wrote from years ago. Personally, I did this so I would feel less attached to my Facebook profile (and hence feel the need to use it less).

Dependencies

  • This tool requires at least Python 3.7 in order to run.
  • A recent copy of Chrome or Chromium installed and available in your $PATH

Installation

You have several options to run it.

  1. Install from PyPI with pip3 install --user delete-facebook-posts (recommended you do this in a virtualenv to avoid incompatibilities)
  2. Clone this repo and run pip3 install --user . or do pip3 install --user git+https://github.com/weskerfoot/DeleteFB.git
  3. Set up a Python virtualenv, activate it, and run pip3 install -r requirements.txt, then you can just run python -m deletefb.deletefb in the DeleteFB directory.
  4. Use the docker image (experimental) by running make after checking this repository out with git. There is also an image built and published automatically at wjak56/deletefb:latest

Chromedriver

The tool will attempt to detect the version of Chrome that you have installed and download the appropriate chromedriver. It is possible that it might fail to find your chrome version if you are running on Windows. If that is the case, please try running the docker version.

How To Use It

usage: deletefb [-h] [-M {wall,unlike_pages,conversations}] -E EMAIL [-P PASSWORD] -U PROFILE_URL [-F TWO_FACTOR_TOKEN] [-H] [--no-archive] [-Y YEAR]
                [-B CHROMEBIN]

optional arguments:
  -h, --help            show this help message and exit
  -M {wall,unlike_pages,conversations}, --mode {wall,unlike_pages,conversations}
                        The mode you want to run in. Default is `wall' which deletes wall posts
  -E EMAIL, --email EMAIL
                        Your email address associated with the account
  -P PASSWORD, --password PASSWORD
                        Your Facebook password
  -U PROFILE_URL, --profile-url PROFILE_URL
                        The link to your Facebook profile, e.g. https://www.facebook.com/your.name
  -F TWO_FACTOR_TOKEN, --two-factor TWO_FACTOR_TOKEN
                        The code generated by your 2FA device for Facebook
  -H, --headless        Run browser in headless mode (no gui)
  --no-archive          Turn off archiving (on by default)
  -Y YEAR, --year YEAR  The year(s) you want posts deleted.
  -B CHROMEBIN, --chromebin CHROMEBIN
                        Optional path to the Google Chrome (or Chromium) binary
  • Make sure that you have a recent version of Python 3.x installed (preferably 3.7 or greater)

  • Make sure that you have Google Chrome installed and that it is up to date

  • The tool will attempt to automatically install chromedriver for Selenium. See here for an explanation of what the chromedriver does. You may have to manually install it if auto-install fails.

    • On Linux, it will be called something like chromium-chromedriver or just chromium.

    • On MacOS, it will be available via brew, with the following commands:

      brew install chromedriver
      
  • Run deletefb -E '[email protected]' -P 'yourfacebookpassword' -U 'https://www.facebook.com/your.profile.url'

  • The script will log into your Facebook account, go to your profile page, and start deleting posts. If it cannot delete something, then it will "hide" it from your timeline instead.

  • Be patient as it will take a very long time, but it will eventually clear everything. You may safely minimize the chrome window without breaking it.

Login

  • The tool will log in using the credentials passed to it. It will wait until the page https://www.facebook.com/ is loaded in order to avoid any issues with logging in. If you pass a 2FA token explicitly with the -F option, then it will try to enter that for you. If there are any issues, it simply pauses indefinitely to allow the user to resolve the problems, and then continues execution.

2FA

  • It is recommended that you disable Two-Factor Authentication temporarily while you are running the script, in order to get the best experience.

  • If you run into issues with Facebook complaining about your browser, currently the only workaround is to manually click through them.

  • If you do have 2-Factor Auth configured then the script will pause for 35 seconds to allow you to enter your code and log in.

  • You may also pass in a code by using the -F argument, e.g. -F 111111.

Delete By Year

  • The tool supports passing the --year flag in order to delete/archive by year. E.g. -Y 2010 would only affect posts from 2010.

Archival

  • The tool will archive everything being deleted by default in .log files. Currently they are simply stored as JSON objects for each line in the log. It will archive the content, and a timestamp if it is available. You may disable this feature by using --no-archive.

Headless mode

  • The tool supports running Chrome in headless mode with the --headless option, which may be preferable if you plan on running it in the background.

Bugs

If it stops working or otherwise crashes, delete the latest post manually and start it again after waiting a minute. I make no guarantees that it will work perfectly for every profile. Please file an issue if you run into any problems.

deletefb's People

Contributors

alfred-sa avatar connorskees avatar dependabot[bot] avatar esirk avatar gwgundersen avatar hvtuananh avatar ianfhunter avatar ijustlovemath avatar iloveitaly avatar jeffcarpenter avatar metaver5o avatar mimischi avatar mohamedbarhdadi avatar seands avatar shadahm avatar spirit-act avatar thomascrha avatar tklam avatar weskerfoot avatar wikijm 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

deletefb's Issues

bash: deletefb: command not found

I ran the instructions but for some reason when I tried running the script "deletefb -E ...", it gave me a "bash: deletefb: command not found" error. Here's the code I ran:

  1. pip install --user delete-facebook-posts
  2. brew tap homebrew/cask;
  3. brew cask install chromedriver
  4. "deletefb -E "

Delete comments/likes on other people's timelines

Settings -> Your Facebook Information -> Access Your Information -> Posts ->

URL looks like: https://www.facebook.com/profile.php?id=< identity value >&sk=allactivity&category_key=likedposts&privacy_source=access_hub&entry_point=ayi_hub

I'm a newb so idk how to help with the code. Ran deletefb and everything came off my wall just fine. Double checked the location above and likes/posts on other people's walls are hidden away in a different menu.

Any chance to expand functionality? Thanks for the tool!

Error on OSX

Running on OSX, running deletefb with the passed parameters produces the following:

> Traceback (most recent call last):
>   File "./deletefb.py", line 139, in <module>
>     run_delete()
>   File "./deletefb.py", line 58, in run_delete
>     is_headless=args.is_headless
>   File "./deletefb.py", line 81, in delete_posts
>     driver = Chrome(options=chrome_options)
>   File "/Users/joe/Library/Python/2.7/lib/python/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
>     self.service.start()
>   File "/Users/joe/Library/Python/2.7/lib/python/site-packages/selenium/webdriver/common/service.py", line 76, in start
>     stdin=PIPE)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
>     errread, errwrite)
>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
>     raise child_exception
> OSError: [Errno 20] Not a directory

Encountered this before?

Problem logging in

Whenever I run the program, it goes to Facebook, and enters the login information. I copy the email, and URL from a firefox window, and the password from my password manager. It then sends the Chrome window to:
https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110

where I reenter the same login credentials (copy-paste) and then it logs in correctly however by then, the program hits an error.

I do not have 2FA enabled

Proposed solution: If it hits this webpage, then check the url every few seconds, until the user inputs the email-password manually and hits login. after that continue running the program

On line 100 of login.py add:

while Driver.getCurrentUrl()=="https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110":

time.sleep(5)

Support deleting by year

Add an option to filter only by certain years. Most likely the easiest way to implement this would be to make the script just do a search for posts in a certain time period and then use the same delete logic.

Support for Grid View in the timeline to defeat Facebook's measures

Hi,

I had 10 years of posts to be deleted, I deleted 5 years of posts with this script and after the 5th year, Facebook disabled the ListView and only Grid View was available.

Timeline has 2 modes of displaying posts, List View & Grid View. I have reasons to believe Facebook disables the List View after deleting several posts and only Grid View is available there after.

Grid View is not currently being handled in the script.

InvalidArgumentException raised during initial page load

Installed through pip3 on Mint, this program worked perfectly for hours. After doing a facebook official data backup, I consistently see the following error when calling with -M wall -Y 2014

Traceback (most recent call last):
File "/home/fshs/.local/bin/deletefb", line 11, in
sys.exit(run_delete())
File "/home/fshs/.local/lib/python3.6/site-packages/deletefb/deletefb.py", line 110, in run_delete
year=args.year
File "/home/fshs/.local/lib/python3.6/site-packages/deletefb/tools/wall.py", line 27, in delete_posts
driver.get(user_profile_url)
File "/home/fshs/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "/home/fshs/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/fshs/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
(Session info: chrome=75.0.3770.90)

$ uname -a
Linux ------ 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ apt policy chromium-browser chromium-chromedriver python3 python3-pip
chromium-browser:
Installed: 75.0.3770.90-0ubuntu0.18.04.1
Candidate: 75.0.3770.142-0ubuntu0.18.04.1
Version table:
75.0.3770.142-0ubuntu0.18.04.1 500
500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
*** 75.0.3770.90-0ubuntu0.18.04.1 100
100 /var/lib/dpkg/status
65.0.3325.181-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
chromium-chromedriver:
Installed: 75.0.3770.142-0ubuntu0.18.04.1
Candidate: 75.0.3770.142-0ubuntu0.18.04.1
Version table:
*** 75.0.3770.142-0ubuntu0.18.04.1 500
500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
100 /var/lib/dpkg/status
65.0.3325.181-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
python3:
Installed: 3.6.7-118.04
Candidate: 3.6.7-1
18.04
Version table:
*** 3.6.7-118.04 500
500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
100 /var/lib/dpkg/status
3.6.5-3 500
500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
python3-pip:
Installed: 9.0.1-2.3
ubuntu1.18.04.1
Candidate: 9.0.1-2.3ubuntu1.18.04.1
Version table:
*** 9.0.1-2.3
ubuntu1.18.04.1 500
500 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
100 /var/lib/dpkg/status
9.0.1-2 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages

bash: password: event not found

Hi,
I tried to execute deletefb according to the readme file but I encountered an "even not found" issue with some portion of my password.

Support for deleting bundle post

When you have birthday messages they are bundle in a post for now the script it's only hiding all of them which could look for the bundle post and delete every one of them.

Scramble the posts before deleting them

From HackerNews: "I think the more effective script would be one that goes through all of your FB posts and scrambles them, or replaces the text with gibberish."

For more confidence, it could be nice to update the post with random data and then delete it.

Pause to enter two-factor authentication code

Currently the delay between login and trying to start deleting posts is far too short, resulting in it being quite difficult to get the script to wait while I complete the login process.

hang on Bio update

I have a Bio update that can not be deleted, so the script hang on the page, waiting for nothing and can not go further.

Modularize the visibility filter, content filter, action, and archive options

Hi,

If you could modularize along the following lines:

  • visibility filter=default is "non-hidden" (to optimise processing), can be set to "all" messages
    • content filter=default is "none" , can be set to "match keyword"
      • Pattern matching can be done by appending to the facebook url activity log itself (and thereby making facebook do the heavy lifting on the server side).
      • Inverting the keyword match, Matching a pattern, Inverting the pattern match can be stretch goals
  • action=default is "hide" (non-destructive default but still private and inaccessible), can be set to "delete"
    • archive=default is "save" the fsm div to JSON whose filename is set to the original timestamp , can be set to "don't save"

then users can choose a variety of actions. e.g.

  • Users can now feed a list of keywords to hide for e.g. travelling to China ? hide/delete your "Tibet" and "Hong Kong" posts.
  • Users can make all posts about a specific trip private and inaccessible, while leaving the rest of their facebook content accessible

__init__() got an unexpected keyword argument 'options'

This might be a noob mistake but I'm getting "init() got an unexpected keyword argument 'options'" after trying to run the script. The error tells me to install chromedriver for Selenium but I already have it since when I run "chromedriver --version", I get a proper version back.

Support unlike all pages

I'm using facebook since I was a teenager and I liked 1000+ pages that are absolutely useless. Is there any way to unlike all the pages at once, same way you did with posts ?

Archive also external links

I have many posts with links to YouTube and stuff like that. In the archive content for those posts is simply empty. It would be great if archive would preserve those links and save them in JSON.

Can i use it in mac with chrome?

As when i start the chromedriver ,it keeps open and display "Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port xxxx"
Is this the way it should work?

bash: deletefb: command not found

deletefb script was installed on Mac 10.14.5 in /Users/<USERNAME>/Library/Python/2.7/bin I tried copying the deletefb script file to ~/.local/bin/deletefb but that doesn't work either and I get

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/config.py", line 562, in configure
handler = self.configure_handler(handlers[name])
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/config.py", line 735, in configure_handler
result = factory(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py", line 434, in init
logging.FileHandler.init(self, filename, mode, encoding, delay)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/init.py", line 1092, in init
StreamHandler.init(self, self._open())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/init.py", line 1121, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 1] Operation not permitted: '/usr/deletefb.log'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/bin/deletefb", line 11, in
load_entry_point('delete-facebook-posts==1.1.7', 'console_scripts', 'deletefb')()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 2793, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 2411, in load
return self.resolve()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/init.py", line 2417, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/Users/[user]/Library/Python/3.7/lib/python/site-packages/deletefb/deletefb.py", line 4, in
from .tools.likes import unlike_pages
File "/Users/[user]/Library/Python/3.7/lib/python/site-packages/deletefb/tools/likes.py", line 8, in
LOG = logger(name)
File "/Users/[user]/Library/Python/3.7/lib/python/site-packages/deletefb/tools/common.py", line 45, in logger
logging.config.dictConfig(config["logging"])
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/config.py", line 799, in dictConfig
dictConfigClass(config).configure()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/config.py", line 570, in configure
'%r' % name) from e

Use Facebook API instead

I am just wondering if using something like requests with the Facebook API would be more reliable and faster. I haven't looked into how it would work for normal users though.

Run in docker

Would be useful to write a Dockerfile that will build an image to run it in headless mode.

This would probably require implementing proper logging so that the user can see what's going on. It would make daemonizing it trivial.

Stuck in login page when 'Save browser' is displayed after 2FA

Hi,

when 2FA is enabled, there are different flow involved which is currently not being handled and without which the script cannot serve its intended purpose.

'Save browser'

Each time when 2FA is enabled, save the browser screen is shown. The action is currently not being handled.

While on 'Save browser' screen, the page is reloaded to show the time-line but since the user is not logged in yet; the script is struck in the login page again.

Temporary fix : While being struck on login screen after selecting 'Save browser', we can login manually and go to timeline page for the script to do its job. Temporary fix cannot be applied during '--headless'.

Permanent fix : Need to handle this case in the script.

ModuleNotFoundError

Hi,

I use virtual env, pip and requirements is good.

If i launch it, don't work :
python3.7 deletefb.py

Traceback (most recent call last):
  File "deletefb.py", line 2, in <module>
    from .tools.common import logger
ModuleNotFoundError: No module named '__main__.tools'; '__main__' is not a package

Thank you.

Implement localization

Certain features are going to be difficult to support in languages other than English, because it is difficult to implement things robustly in some cases without checking the text content of elements.

Therefore I'm going to propose that in such cases it would use localization. E.g. with https://docs.python.org/3/library/gettext.html

However I do not want to spend a lot of time implementing many languages to start with, so I'm only going to work on converting the code to use a localization interface. I'm open to suggestions other than gettext if something else works better.

This might be over-engineering at this point too. I don't know.

Originally posted by @weskerfoot in #31 (comment)

after update to 1.1.2, deletefb crash with FileNotFoundError

I have just updated to 1.1.2, then

# deletefb -E ### -P ### -U ### -Y 2011 
Traceback (most recent call last):
  File "/home/dominix/.local/bin/deletefb", line 11, in <module>
    load_entry_point('delete-facebook-posts==1.1.2', 'console_scripts', 'deletefb')()
  File "/home/dominix/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/dominix/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/home/dominix/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/home/dominix/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/dominix/.local/lib/python3.6/site-packages/deletefb/deletefb.py", line 13, in <module>
    from .tools.likes import unlike_pages
  File "/home/dominix/.local/lib/python3.6/site-packages/deletefb/tools/likes.py", line 8, in <module>
    LOG = logger(__name__)
  File "/home/dominix/.local/lib/python3.6/site-packages/deletefb/tools/common.py", line 46, in logger
    with open(config_path, "r", encoding="utf-8") as config_file:
FileNotFoundError: [Errno 2] No such file or directory: 'deletefb/logging_conf.json'

Refactor archiver into class

Hello! I was thinking that a better way to structure the archival(?) system would be to have it in a class somewhat like this:

import os
from os.path import abspath, curdir, isdir
import uuid

class Archive:
    ARCHIVE_TYPES = ["posts", "likes", "wall", "photos"]
    def __init__(self):
        self.original_dir = curdir
        if abspath(curdir).endswith(("tools",)):
            os.chdir("..")

        if not isdir("archive"):
            os.mkdir("archive")

        os.chdir("archive")

        for archive_type in self.ARCHIVE_TYPES:
            if not os.path.isdir(archive_type):
                os.mkdir(archive_type)

    def __del__(self):
        os.chdir(self.original_dir)

    def post(self, data):
        directory = "posts/{0}".format(data["date"])  # date in ISO 8601
        os.mkdir(directory)
        with open(directory + "/{0}.json".format(uuid.uuid4()), mode="w") as f:
            json.dump(data, f, ensure_ascii=False, indent=2, sort_keys=True)

    def likes(self, data):
        pass

    def wall(self, data):
        pass

    def photos(self, data):
        pass

where the data for the post would look like

data = {
  "date": "2019-06-03T00:00:00",
  "content": "lorem ipsum sit amet",
  "comments": [
    {
      "poster": "alexJOnes",
      "content": "foobar baz quinquoz"
    }
  ],
  "reactions": {
    "like": ["user3"],
    "love": [],
    "sad": ["user1", "user2"],
    "haha": [],
    "wow": [],
    "angry": [],
  }
}

I don't use Facebook so I'm not totally sure what other information is given/relevant. I used a uuid as the filename because when I looked, all posts only had dates and not times associated with them and posts don't normally have titles. It might also be worthwhile to sanitize the comments with emoji

Please let me know what your thoughts are :)

TypeError: attrs only works with new-style classes.

Upon running the run command provided in the readme, I receive the following response:

Traceback (most recent call last):
  File "/Users/ddover/Library/Python/2.7/bin/deletefb", line 9, in <module>
    load_entry_point('delete-facebook-posts==1.1.5', 'console_scripts', 'deletefb')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/ddover/Library/Python/2.7/lib/python/site-packages/deletefb/deletefb.py", line 4, in <module>
    from .tools.likes import unlike_pages
  File "/Users/ddover/Library/Python/2.7/lib/python/site-packages/deletefb/tools/likes.py", line 1, in <module>
    from .archive import archiver
  File "/Users/ddover/Library/Python/2.7/lib/python/site-packages/deletefb/tools/archive.py", line 17, in <module>
    @attr.s
  File "/Users/ddover/Library/Python/2.7/lib/python/site-packages/attr/_make.py", line 959, in attrs
    return wrap(maybe_cls)
  File "/Users/ddover/Library/Python/2.7/lib/python/site-packages/attr/_make.py", line 893, in wrap
    raise TypeError("attrs only works with new-style classes.")
TypeError: attrs only works with new-style classes.

I installed the script using the "pip install --user delete-facebook-posts" method of installation. I am running MacOS 10.14.5 with the latest version of Chrome installed. I installed Chromedriver using "brew cask install chromedriver".

Any ideas on how to fix this? I have tested selenium and chromedriver with other scripts and they are working fine.

Improve reliability and run daemonized

Right now, it will just crash if it runs into any errors. It would be a nice feature if it were:

  1. Able to work in headless mode, and run as a daemon.
  2. Recover from crashes, and detect when you have no posts left to delete
  3. Schedule deletion of posts, so that you can use it in a cron-like manner to regularly delete things you've posted.

Support deleting all comments

This issue builds on top of #21 ,

I would like to be able to delete all my comments. There was a Chrome extension in the past called Social Book Post Manager, but it does not seem to work anymore.

Based on a very short investigation, the following steps may work:

Get it working with geckodriver

I would like to ditch Chrome and get it working with the geckodriver at some point. That way people do not have to install Chrome/Chromium if they would rather not.

Support to delete also all old private messages

There can be many of them and deleting them manually takes a long time.

I think the MVP could be simply deleting full conversations with anyone you have not talked since year X (so similar to timeline deletion, with --year 2018 it would delete only full conversations which have been last updated in 2018).

A more interesting approach could be to delete only individual messages in all conversations for a given year. Not sure if one can delete also messages from the correspondent. I think that maybe deleting full conversation is then better.

Wall post and timestamp class names incorrect

Just ran this and was getting SELENIUM_EXCEPTIONS when it tried to get the post and timestamp elements. Did some debugging in Pycharm and saw the error message was No element found for selector "_5_jv" and No element found for selector "timestamp". Looks like the class names have changed. I set the post_content_sel variable to "_5pcb" and the post_timestamp_sel variable to "timestampContent" and the program began to work as expected. I got the new class names from inspecting the elements on the page. Not sure if they are the same for everyone, but this was the case for myself and a friend's account.

Support headless mode

I haven't tested this but it shouldn't make any difference. It is a prerequisite for running it as a daemon.

Prompt for password if it isn't passed in

It might be helpful for people who are paranoid about their bash history to have the option of entering their password interactively.

Additionally, it could detect if you passed an empty string and prompt for it in that case as well.

A workaround at the moment is to prefix your invocation of the command with a space which will cause bash (and maybe other shells?) to not log it in your history.

Stuck on post where neither "deleting" nor "hiding" was an option

Maybe related to #17. The program seems to have been stuck on a post from 2013 where neither "deleting" nor "hiding" was an option. I manually "untagged" me from the post/photo and restarted the program, which worked fine, but this might want to be considered fixing as a future enhancement.

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.