Share Pastebin
Guest
Public paste!

NiggerGrinder

By: a guest | Jul 3rd, 2009 | Syntax: PHP | Size: 2.40 KB | Hits: 9 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. <?php
  2.  
  3. // INSTRUCTIONS:
  4. // 1.  Register 3 (three) accounts on Twitter - no email validation, so it's easy. You can't just use one account because it will get blocked quickly.
  5. // 2. Save this script (click download above) as "twitter.php" in C:\Documents and Settings\Your_Username
  6. // 3. Edit the file with notepad, fill in the usernames and passwords of the three accounts you've registered - see below, it's really simple
  7. // 4. Install PHP 5.3 from http://php.net (direct Windows download - http://windows.php.net/download)
  8. // 5. Open command line (Start -> Run -> cmd.exe)
  9. // 6. Type in php -f twitter.php and leave it running
  10. // 7. ????
  11. // 8. PROFIT
  12.  
  13. $accounts = array( // fill in usernames/passwords here as shown below
  14. array('username1', 'password1'),
  15. array('username2', 'password2'),
  16. array('username3', 'password3')
  17. );
  18. // have fun
  19.  
  20. $timer = 15;
  21.  
  22. $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20091204 Firefox/3.5.0.1";
  23.  
  24. $tweetUrl = 'http://www.twitter.com/statuses/update.xml';
  25. $topicUrl = 'http://search.twitter.com/trends/current.json';
  26.  
  27. $cnt = 0;
  28.  
  29. while(1) {
  30.   $content = file_get_contents($topicUrl);
  31.   $content = json_decode($content, true);
  32.  
  33.   $topics = array();
  34.  
  35.   foreach ($content["trends"] as $a => $b) {
  36.    foreach($b as $c) {
  37.      $topics[] = $c["name"];
  38.    }
  39.   }
  40.   if($topics[0]) break;
  41. }
  42.  
  43. while(1) {
  44.  
  45.   $status = '#gorillapenis';
  46.  
  47.   $status = $status . ' ' . $topics[rand(0,count($topics)-1)];
  48.  
  49.   $status = urlencode(stripslashes(urldecode($status)));
  50.  
  51.   $rand = rand(0, count($accounts)-1);
  52.   $username = $accounts[$rand][0];
  53.   $password = $accounts[$rand][1];
  54.  
  55.   $curl = curl_init();
  56.   curl_setopt($curl, CURLOPT_URL, "$tweetUrl");
  57.   curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
  58.   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  59.   curl_setopt($curl, CURLOPT_POST, 1);
  60.   curl_setopt($curl, CURLOPT_POSTFIELDS, "status=$status");
  61.   curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
  62.   curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
  63.   $result = curl_exec($curl);
  64.   $resultArray = curl_getinfo($curl);
  65.  
  66.   if ($resultArray['http_code'] == 200) {
  67.     $cnt++;
  68.     echo "Tweet posted from account $username. ";
  69.     echo "Altogether, $cnt tweets posted.\n";
  70.   } else {
  71.     echo "$result";
  72.     echo "Could not post tweet to Twitter right now. Try again later.\n";
  73.   }
  74.  
  75.   curl_close($curl);
  76.   sleep($timer);
  77.  
  78.  
  79. }
  80.  
  81. ?>