[GET] Mass Un-Follow Twitter Script

greenovni

Regular Member
Joined
Feb 8, 2008
Messages
223
Reaction score
157
Hello everyone, its been a while since I stopped by here and wanted to give you this little gift.

A lot of you have multiple twitter accounts for your niches and follow people in order to gain people following you back. Unfortunately with twitter, you can only follow up to 2,000 people at any one time.

Unfollowing by hand can be a real pain in the butt so here is a little PHP script that you can upload to your server and run every time you want to unfollow a ton of people at once

<?php
// 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 '<h1>Success Connate</h1><hr>';
}
// 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<br/><hr>';
}

}
?>

Your server would need CURL in order to run this script.

Directions:

1. copy code into a txt file
2. Set your twitter user name and password
3. Save as whatever you want .php
4. upload to your webhost
5. visit http://yourdomain.com/whateverscriptname.php

If any questions, leave them here on the thread.
 
Thank you for the script!

can you add input form (to change other user/password without opening file) and a proxy handler as well?
 
<body>
<form action="http://YourDomain.com/ScriptName.php" method="post" >
<table width="298" height="87" border="0">
<tr>
<th width="96" align="left" class="about" scope="col"><h5>Username :</h5></th>
<th width="192" align="left" scope="col">

<input name="username" type="text" />
</th>
</tr>
<tr>
<th align="left" scope="row"><h5>Password :</h5></th>
<td align="left">
<input name="password" type="password" />
</td>

</tr>
<tr>
<th height="31" scope="row"> </th>
<td><strong>
<input type="submit" />
</td>
</tr>
</table>
</form>

</body>

Like this?
 
nice!! add the forms to the first one, and it will be sweet!
 
Back
Top