Delete Facebook Activities automatically using iMacros – Today, one of my friend posted (not him actually, the app posted it. Thanks to Facebook for allowing apps to post behalf of us) “Grab your Free Battlefield 3 Premium Code Today!” post.
Facebook

The friend who’s profile posted this on my wall is a technology enthusiast so I went ahead and clicked on that offer (Later I realized it was unintentionally clicked by my Facebook friend). After clicking couple of links here and there,  I saw my Facebook profile has become a Spambot (This is why we should read page or application permissions page before allowing). That Scam application (https://www.facebook.com/FreeGamingArena) shared the same message to everyone in my friend list. Obviously this was a scam, they never give any free keys (STAY AWAY FROM SUCH OFFERS, OTHERWISE YOUR ACCOUNT WILL BE IN DANGER).

More information about “Offers that turn your FaceBook account into SpamBot”  

I immediately unliked the page and revoked permissions. But the next big thing was the message posted by Free-Gaming-Arena application. Facebook doesn’t provide mass delete / remove facility on any of their feature. The only way of deleting posted message on my friend’s wall was deleting them manually. I have over 300 friends on FaceBook and deleting this activity one by one could take a lot of time. I was worried about message being spread everywhere. I wanted to keep my as well as my friend’s facebook account clean. I

Suddenly I realized I have iMacros plugin on Firefox browser. I decided to code a macro which will automatically delete all those activities one by one. By using macros, I deleted all those unwanted activities within few minutes. All I had to do is sit and watch iMacros doing some magical stuff on my Facebook account. 🙂

Here’s how you can remove unwanted Facebook Activities from my Facebook account.

  1. Download and Install Firefox or Install Chrome
    Download and Install iMacros for Firefox or Install iMacros for Chrome
    Download this macro : http://www.mediafire.com/?4tp44pcdaq48jzs
  2. Paste it in iMacros directory (usually Drive:\Users\<Username>\Documents\iMacros\Macros)
  3. Log In to Facebook and open Activity Log (https://www.facebook.com/<username>/allactivity )
  4. Firefox logo users – Open iMacros Panel by pressing F8.  users – Click on iMacros button just besides Wrench (Settings) button on top right corner.
  5. Select facebookactivity.iim
  6. Click on Play or Play Loop (Select value depending on number of activities you want to delete)
  7. Let the iMacros do the rest of work.

Macro code :

VERSION BUILD=7500718 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=I ATTR=CLASS:mrs<SP>defaultIcon<SP>customimg<SP>img<SP>sp_b0ftda<SP>sx_ad4be6&&TXT:
TAG POS=1 TYPE=SPAN ATTR=CLASS:itemLabel<SP>fsm&&TXT:Delete...
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:ok&&VALUE:Delete
WAIT SECONDS=2

You can change tag position in 3rd line, TAG POS = 1 specifies first activity on page will be deleted. E.g. If you want to keep first 4 activities from Activity Log, you can set TAG POS =4. I haven’t done much experiments, I have just customized code on my personal knowledge basis.

Please share if you have any optiomised code 🙂

  • yay!! That friend is me!! w00t w00t w00t!!!111

  • Kevin Sun

    Hey, whenever I run the code, I get

    RuntimeError: element I specified by CLASS:mrsdefaultIconcustomimgimgsp_b0ftdasx_ad4be6&&TXT: was not found, line: 3 (Error code: -921)

    How do I fix this? Thanks! =]

    • Can you please specify which browser do you use?

  • Jason

    Hey Rahul, I just sent you an email concerning this article! Please respond!

    • I will help you out 🙂 Weekend here. Will be in touch.

  • berg

    Hey, have you tried this script lately? im getting an error when trying to run it. Maybe they changed the element name?

    RuntimeError: element I specified by CLASS:mrsdefaultIconcustomimgimgsp_b0ftdasx_ad4be6&&TXT: was not found, line: 3 (Error code: -921)

  • Luca

    RuntimeError: element I specified by CLASS:mrsdefaultIconcustomimgimgsp_b0ftdasx_ad4be6&&TXT: was not found, line: 3 (Error code: -921)

  • Luca

    I meant, same problem here, sorry

    • berg

      Done some testing and this script works to delete Comments.
      Go to your allactivity page and select Comments, then this script will delete the first comment and wait 4 seconds. When you delete facebook will reload the comments so you have to wait for that to happen or else it wont work. Adjust the seconds to fit your internet/computer speed.. I guess this would work on “likes” too.

      Scroll down to load as many comments as you want if u wanna run the script in a big loop, I just tried it in a loop of 300 times and it worked, but then it stopped since it doesnt “reload more” automatically.

      VERSION BUILD=8211213 RECORDER=FX
      TAG POS=1 TYPE=SPAN ATTR=CLASS:uiButtonText
      TAG POS=1 TYPE=SPAN ATTR=TXT:Delete…
      TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:ok&&VALUE:Delete
      WAIT SECONDS = 4

      • Thanks for the solution 🙂

  • Bai XiLi

    Works as of Feb 2, 2013, Change security settings to something other than friends only, and hides items from you timeline.

    Also, the DS lines may need to be changed due to screen configuration. Set them to hover the mouse over the pencil so it will appear for image recognition. Though since we’ve defined the load size, it may already be right. Use the Image capture to make the needed files for image validation. Starting the code with a year ensures that posts pull up into the same position each time, so the DS mouse can hover and open menus.

    And, the way this is unique from all the other codes: it makes your posts private visible only to you, and then takes them off your timeline. If you want only one or the other, chunk out the code accordingly. This is imacros, and I was using it in windows environment.

    VERSION BUILD=8032216
    TAB T=1
    TAB CLOSEALLOTHERS
    SET !ERRORIGNORE YES
    SET !TIMEOUT 10
    URL GOTO=https://www.facebook.com/YOURFBNAMEHERE/timeline/2012
    SIZE X=1087 Y=565
    WAIT SECONDS=2
    IMAGECLICK POS=1 IMAGE=20130128_1350.PNG CONFIDENCE=80
    WAIT SECONDS=1
    TAG POS=1 TYPE=SPAN ATTR=TXT:OnlyMe(+)
    WAIT SECONDS=1.5
    DS CMD=MOVETO X=432 Y=201 CONTENT=
    IMAGECLICK POS=1 IMAGE=FBpencil.png CONFIDENCE=95
    WAIT SECONDS=1.5
    TAG POS=1 TYPE=SPAN ATTR=TXT:HidefromTimeline
    WAIT SECONDS=1

    • Murilo Henrique

      not work with me bro

      • Try new solutions posted by users in comments. Since Facebook changes their page layout time to time it may fail.

        • Kitty

          Had some problems with the timeline feat. the macro.
          Worked around it.
          Am actually quite proud of myself, cuz I’ve never done something like this before. <3

          Hope, that might help some users.

          VERSION BUILD=8300326 RECORDER=FX
          TAB T=1
          TAB CLOSEALLOTHERS
          SET !ERRORIGNORE YES
          SET !TIMEOUT 10
          URL GOTO=https://www.facebook.com/YOUFACEBOOKNAMEHERE/timeline/2012
          TAG POS=1 TYPE=SPAN ATTR=TXT:Delete…
          TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:ok&&VALUE:Delete
          TAG POS=1 TYPE=I ATTR=CLASS:_5cg_4__7&&TXT:
          TAG POS=1 TYPE=SPAN ATTR=TXT:Delete…
          TAG POS=1 TYPE=LABEL ATTR=CLASS:uiButtonuiButtonLargeuiButtonConfirm&&TXT:
          WAIT SECONDS=5

          • Hahah, Amazing..

            Since Facebook changes it’s layout every now and then, we need to do some workaround in order make the macro work.. Glad you made it work. Do share your thoughts, keep visiting.

            Regards,
            Rahul.

  • imacros
    • What is that file about?

  • Is there any code to delete posts from a page wall?

    • Sorry Joseph, I have not worked with page wall code yet. May be in future, I will write an article about it. 🙂

  • youareknotworthy

    these are only temp fixes. facebook updates are too constant and fail too frequently.

  • Hafizkey

    I am admin for a few of Facebook Pages…Can i use imacro for delete all my facebook page post?

  • Ahmed Tokyo

    VERSION BUILD=8070701 RECORDER=CR
    URL GOTO=https://www.facebook.com//allactivity /// link to timeline review
    WAIT SECONDS=2
    TAG POS=3 TYPE=I ATTR=CLASS:mrs_2fmuimgsp_CWxpkLe1fNhsx_9a5e85&&TXT:
    TAG POS=2 TYPE=SPAN ATTR=TXT:Delete
    WAIT SECONDS=2
    TAG POS=1 TYPE=BUTTON FORM=ID:u_7_1 ATTR=TXT:DeletePost
    WAIT SECONDS=2
    TAG POS=3 TYPE=I ATTR=CLASS:mrs_2fmuimgsp_CWxpkLe1fNhsx_9a5e85&&TXT:
    TAG POS=4 TYPE=SPAN ATTR=TXT:Delete
    TAG POS=1 TYPE=BUTTON FORM=ID:u_a_1 ATTR=TXT:DeletePost
    WAIT SECONDS=2
    REFRESH

    Facebook layout 4 th of july 2014 , 2 deletes per loop

  • Dan

    It doesn’t seem to work… Any updated version?