Script To Unfollow Many Twitter Users You Are Following: Mass Unfollow

Many people have many accounts on twitter and follow many people so that those people they followed can follow them back in return. But the most staggering thing with twitter is that you can only follow 2,000 people at a time.


mass-twitter-unfollow-script

Check: Top 5 Best Tools to Bulk/Mass Unfollow on Twitter

Today, I found a simple PHP script online that may relief you from manually unfollow those people you followed. This simple PHP script must be uploaded to a server and run it every time you want to do mass unfollow on your twitter account. Your server needs cURL before this script can run.

Here is the Script:



// Set username and password

$username = ‘username’;
$password = ‘password’;
// The twitter API address
$url = ‘http://www.twitter.com/friends/ids.xml’;
// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, “$url”);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_GET, 1);
curl_setopt($curl_handle, CURLOPT_USERPWD, “$username:$password”);

$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer)) {
echo ‘Error’;
} else {
echo ‘

Success Connate


’;
}
// xml to array
//
//echo $buffer ;
$xml = simplexml_load_string(“$buffer”);
foreach ($xml->children() as $child)
{
echo ” $child “;
// The twitter API address
$url_2 = “http://twitter.com/friendships/destroy.xml?user_id=$child”;
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, “$url_2″);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, “status=$message”);
curl_setopt($curl_handle, CURLOPT_USERPWD, “$username:$password”);
$buffer_2 = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer_2)) {
echo ‘Error’;
} else {
echo ‘Go to hell

’;
}
}
?>

How To Use & Install The Above Script:
1. Copy and paste the code above in your notepad,
2. Insert your twitter username and password into the script,
3. Save the script in the notepad as anything.php,
4. Then upload the script to you webhost,
5. After you must have uploaded the script successfully, go to the directory of the script e.g. http://www.yourdomain.com/anything.php. Make sure you secure the directory.



Over 50,000 + Readers

Get fresh content from JustNaira


3 Comments

  1. Rani Khairunnisa
  2. Andi Widiyanto
  3. Mohit Bumb

Leave a Reply