Browse Source

Stubs for removing messages and comments, new type for convos

pull/72/head
Wesley Kerfoot 5 years ago
parent
commit
6e8970b23f
  1. 15
      deletefb/tools/comments.py
  2. 15
      deletefb/tools/messages.py
  3. 6
      deletefb/types.py

15
deletefb/tools/comments.py

@ -0,0 +1,15 @@
from .archive import archiver
from ..types import Comment
from .common import SELENIUM_EXCEPTIONS, logger, click_button
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
LOG = logger(__name__)
def delete_comments(driver, profile_url):
"""
Remove all comments on posts
"""
driver.get("{0}/allactivity?privacy_source=activity_log&category_key=commentscluster".format(profile_url))

15
deletefb/tools/messages.py

@ -0,0 +1,15 @@
from .archive import archiver
from ..types import Conversation
from .common import SELENIUM_EXCEPTIONS, logger, click_button
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
LOG = logger(__name__)
def delete_comments(driver):
"""
Remove all conversations within a specified range
"""
driver.get("https://www.facebook.com/messages/t/"

6
deletefb/types.py

@ -23,6 +23,12 @@ class Comment:
date = attr.ib(factory=timestamp_now)
name = attr.ib(factory=lambda: uuid.uuid4().hex)
@attr.s
class Conversation:
recipient = attr.ib()
last_message_time = attr.ib(factory=timestamp_now)
name = attr.ib()
@attr.s
class Page:
name = attr.ib()

Loading…
Cancel
Save