Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save connorclarklindh/ccc95f69305c245c057c284f0cd9fd7a to your computer and use it in GitHub Desktop.
Save connorclarklindh/ccc95f69305c245c057c284f0cd9fd7a to your computer and use it in GitHub Desktop.
imacros code to automatically delete facebook messages
'these notes can be removed'
'this script requires the free chrome imacros plugin to run (http://imacros.net/overview)'
'updates to facebook messenger interface will likely break this and it will need to be rebuilt using a new recorded imacro.'
'i tested this on windows 10 using the most updated chrome browser (stable) as of 14/1/2017, future updates may break this.'
'i recommend copy-pasting the delete code as many times as you want to delete in one sitting. I did 20 at a time.'
'i also recommend using "play loop" and setting a loop according to the number of messages you have to delete. The messager page will reload on every loop.'
VERSION BUILD=844 RECORDER=CR
URL GOTO=https://www.facebook.com/messages/
SET LOCATION 0
SET DELAY .1 'make the delay longer if the macro is stopping because the boxes haven't loaded yet.'
'Copy from here to the other comment'
ADD LOCATION 2
TAG POS=1 TYPE=DIV ATTR=ARIA-LABEL:Conversation<SP>actions&&CLASS:_5blh<SP>_4-0h<SP>_p&&ROLE:button&&TABINDEX:0&&TXT:
WAIT SECONDS = {{DELAY}}
TAG POS={{LOCATION}} TYPE=SPAN ATTR=TXT:Delete
WAIT SECONDS = {{DELAY}}
TAG POS=1 TYPE=EM ATTR=TXT:Delete
WAIT SECONDS = {{DELAY}}
'Copy to here and paste below'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment