Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Twitter Mass Unfollow (reverse the Mass Follower script)

I have a script where you can load your username:pass list of all your twitter accounts and then put in the account that you wish for all of the users to follow.

Is there a way to reverse that script? I need a script, where I can load my username:pass list and put in the account so all the users will unfollow that user.

Any help would be appreciate.
I can reverse it PM with the script, and I will do it gladly.
(Oct 17, 2012 07:23 PM)Linux. Wrote:  I can reverse it PM with the script, and I will do it gladly.

Thanks Crypto, I pm the script to you. I appreciate your help.
(Oct 17, 2012 07:32 PM)salventura Wrote:  Thanks Crypto, I pm the script to you. I appreciate your help.

I tired no success. Sorry, again. I may keep trying.
No problem Crypto, I still appreciate you taking the time to look at it.

If anybody else has any ideas or thoughts please let me know.
I can do it for you. PM me the script.
(Oct 17, 2012 08:10 PM)Vlad1k Wrote:  I can do it for you. PM me the script.

Thank you for your time Vlad1k, I pm'd all the info to you.
I would like to get this script as well! Let me know if I can get it once it's done for you!
-ComponY

PHP Code

<?php
    set_time_limit
(false);
    
error_reporting(false);    
    if (isset(
$_POST["perfis"])) {
  
$logins = explode("\n", $_POST["perfis"]);
  
$follow = $_POST["follow"];
  
$contar = count($logins);
  for(
$i = 0; $i <= $contar; $i++) {
    if (!(
preg_match("/[a-zA-Z0-9]+/i", $logins[$i]))) {
    continue;
    }
    
$data = explode(":", $logins[$i]);
    if (
$data[0][0] == "@")
    
$data[0] = str_replace("@", "", $data[0]);
    
$ch = curl_init();
    
curl_setopt_array($ch,
    array(
    
CURLOPT_URL => "http://api.twitter.com/1/friendships/create/{$follow}.xml",
    
CURLOPT_RETURNTRANSFER => 1,
    
CURLOPT_SSL_VERIFYPEER => 0,
    
CURLOPT_COOKIE => null,
    
CURLOPT_HEADER => true,
    
CURLOPT_NOBODY => false,
    
CURLOPT_POSTFIELDS => "&follow=true",
    
CURLOPT_USERPWD => trim($data[0]) . ":" . trim($data[1])
    )
    );

  
$ret = curl_exec($ch);
  if (
preg_match("/Unauthorized/i", $ret)) {
    print 
"<b><font style='color: red;'>".$data[0]." - Error</font></b><br />";
    
flush();
    
ob_flush();
    
sleep(1);
  } else {
    print 
"<b><font style='color: green;'>".$data[0]." - Success</font></b><br />";
    
//include("../loop.php");include("config.php");
    
flush();
    
ob_flush();
    
sleep(1);
  }
    }
}

?>

Is it this one?
(Oct 18, 2012 04:28 AM)Kabyle Wrote:  
PHP Code

<?php
    set_time_limit
(false);
    
error_reporting(false);    
    if (isset(
$_POST["perfis"])) {
  
$logins = explode("\n", $_POST["perfis"]);
  
$follow = $_POST["follow"];
  
$contar = count($logins);
  for(
$i = 0; $i <= $contar; $i++) {
    if (!(
preg_match("/[a-zA-Z0-9]+/i", $logins[$i]))) {
    continue;
    }
    
$data = explode(":", $logins[$i]);
    if (
$data[0][0] == "@")
    
$data[0] = str_replace("@", "", $data[0]);
    
$ch = curl_init();
    
curl_setopt_array($ch,
    array(
    
CURLOPT_URL => "http://api.twitter.com/1/friendships/create/{$follow}.xml",
    
CURLOPT_RETURNTRANSFER => 1,
    
CURLOPT_SSL_VERIFYPEER => 0,
    
CURLOPT_COOKIE => null,
    
CURLOPT_HEADER => true,
    
CURLOPT_NOBODY => false,
    
CURLOPT_POSTFIELDS => "&follow=true",
    
CURLOPT_USERPWD => trim($data[0]) . ":" . trim($data[1])
    )
    );

  
$ret = curl_exec($ch);
  if (
preg_match("/Unauthorized/i", $ret)) {
    print 
"<b><font style='color: red;'>".$data[0]." - Error</font></b><br />";
    
flush();
    
ob_flush();
    
sleep(1);
  } else {
    print 
"<b><font style='color: green;'>".$data[0]." - Success</font></b><br />";
    
//include("../loop.php");include("config.php");
    
flush();
    
ob_flush();
    
sleep(1);
  }
    }
}

?>

Is it this one?

Yes that is the one to follow, I need to make that unfollow. I've tried changing various lines in the script but have not had no luck.
I think you need to change the twitter api usage, not so much the code but the functions being used.
(Oct 18, 2012 12:47 PM)Linux. Wrote:  I think you need to change the twitter api usage, not so much the code but the functions being used.

Code
CURLOPT_URL => "http://api.twitter.com/1/friendships/create/{$follow}.xml",

I believe to unfollow the line should read

Code
CURLOPT_URL => "http://api.twitter.com/1/friendships/destroy

but I'm not sure what else follows.

I've tried changing different lines that read follow to unfollow, etc.. Spent a few hours on it, until my head started to hurt. I only half way know what I'm doing... lol

If I knew more about what I was doing I'm pretty sure it could be made in a short amount of time.
(Oct 18, 2012 01:01 PM)salventura Wrote:  [phpcode] CURLOPT_URL => "http://api.twitter.com/1/friendships/create/{$follow}.xml", [/phpcode]

One moment, I think I know how to fix it :D I will change the function.


Here I found the link for it, this should work.

https://dev.twitter.com/docs/api/1/post/...ps/destroy
I will write some code for it one moment.


Try this code and tell me if it works or not if it does then great.

PHP Code

<?php 
CURLOPT_URL 
=> "http://api.twitter.com/1/friendships/destroy/{$follow}.xml", 
(Oct 18, 2012 01:02 PM)Linux. Wrote:  Try this code and tell me if it works or not if it does then great.

PHP Code

<?php 
CURLOPT_URL 
=> "http://api.twitter.com/1/friendships/destroy/{$follow}.xml", 

Just changing that line did not work, I tried changing that line by itself, as well as changing it to that, and changing some of the other lines with it. No luck as of yet. Once again I appreciate your time.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by M13DAug 15, 2018 04:18 AM 2 362 Aug 15, 2018 04:18 AM
Last Post: blubber87
[PHP] by sonnaxJun 28, 2016 04:12 AM 2 200 Jun 28, 2016 04:12 AM
Last Post: sonnax
[PHP] by Kasual™Dec 18, 2014 06:58 AM 38 2,394 Dec 18, 2014 06:58 AM
Last Post: Han.