Very rarely, you will want to delete all friends from Facebook and start a “fresh” facebook account.
Now, it’s hard to do this manually. Thanks to phpunit + selenium + a few lines of code, this can be done now.
The following script removes all your friends from facebook :) Replace
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://www.facebook.com/");
}
public function testMyTestCase()
{
$this->open("/");
$this->type("email", "<username>");
$this->type("pass", "<password>");
$this->click("//input[@value='Login']");
$this->waitForPageToLoad("90000");
for($i=0; $i<1000; $i++) {
$this->click("link=Profile");
$this->waitForPageToLoad("90000");
$this->click("//a[@href='http://www.facebook.com/sp2hari?sk=friends&v=friends']");
$this->waitForPageToLoad("90000");
$this->click("//div[@class='fbProfileLargePortrait']/a/");
$this->waitForPageToLoad("90000");
$this->click("link=Unfriend");
sleep(5);
$this->click("remove-friend");
$this->waitForPageToLoad("90000");
}
}
}
?>
Note:
1. The script will stop in between with timeout error. You probably should run this script in an infinite loop.
2. Once you’ve reached 0 friends, facebook blocks you from adding friends in bulk for 2 days. So, you probably have to wait till facebook trusts you as human and not a bot. :)
Happy hacking :)
hello, how to start it ?
phpunit Example.php with selenium-rc running in the same machine.
Hi.
I am a PhD student from AUT university. I am doing a phd research on continuous knowledge sharing behaviour. I am very happy to invite you to participate in my online focus group sessions.
If you are interested to join please visit this weblog (http://onlinefocusgroup835609.blogspot.com/). Otherwise thank you for time to read this message.
Regards
Kamarul
imacro?
I’m Sorry but how do i use this… i’m new!!
yeah im new too
could you do it for me? lol
How to run this scrip.
i want to remove my all friends
how to use it? im using google chrome when i put the code at the url, it aitomatically go to google
Ya its Nice !.. But how to apply these code… Please mention… Its unable to understand… what to do ??
ya this is very nice script
Thanks for the nice Script Dude! I am going to use it on the day when all my friends are on Google+ and it is not far. I want to leave Facebook forever. Facebook has become like a public profile. There is no proper privacy. Wanna Ditch it soon.
how can use that one?? can you tell me??
Script not working!