Share Pastebin
Guest
Public paste!

g0rillapen1s

By: a guest | Jul 4th, 2009 | Syntax: PHP | Size: 2.88 KB | Hits: 6 | 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 (the WHOLE file) 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('bernd4711', 'nigger'),
  15. array('bernd1337', 'nigger'),
  16. array('bernd_merkel', 'nigger')
  17. );
  18. // have fun
  19.  
  20. $timer = 15;
  21.  
  22. $useragent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)";
  23. $hashtag = "#gorillapenis";
  24.  
  25. $topics = array(
  26. "ebaums", "nigger", "aids", "cancer", "gorilla", "faggot", "n00b", "penis", "vagina", "asshole",
  27. "butthurt", "ebaumsworld", "koran", "islam", "basement", "retard", "merkel", "listening to", "movie",
  28. "happy hour", "love", "hate", "virgin", "lulz", "nazi", "hitler", "negro", "anime", "manga",
  29. "pooper", "sex", "anal"
  30. );
  31.  
  32.  
  33. $tweetUrl = 'http://www.twitter.com/statuses/update.xml';
  34. $searchUrl = 'http://search.twitter.com/search.json?q=';
  35.  
  36. $cnt = 0;
  37. $ucnt = 0;
  38. $tweets = array();
  39.  
  40. random_tweets();
  41.  
  42. while(1) {
  43.   $status = $hashtag . ' ' . $tweets[rand(0,count($tweets)-1)]; ;
  44.   if (strlen($status) > 140) $status = substr($status,0,140);
  45.   $status = urlencode(stripslashes(urldecode($status)));
  46.   $username = $accounts[$ucnt][0];
  47.   $password = $accounts[$ucnt][1];
  48.   $ucnt++;
  49.   if ($ucnt == count($accounts)) {
  50.    $ucnt = 0;
  51.    $tweets = array();
  52.    random_tweets();
  53.   }
  54.   $curl = curl_init();
  55.   curl_setopt($curl, CURLOPT_URL, "$tweetUrl");
  56.   curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
  57.   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  58.   curl_setopt($curl, CURLOPT_POST, 1);
  59.   curl_setopt($curl, CURLOPT_POSTFIELDS, "status=$status");
  60.   curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
  61.   curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
  62.   $result = curl_exec($curl);
  63.   $resultArray = curl_getinfo($curl);
  64.   if ($resultArray['http_code'] == 200) {
  65.     $cnt++;
  66.     echo "Tweet posted from account $username. ";
  67.     echo "Altogether, $cnt tweets posted.\n";
  68.   } else {
  69.     echo "$result";
  70.     echo "Could not post tweet to Twitter right now. Try again later.\n";
  71.   }
  72.   curl_close($curl);
  73.   sleep($timer);
  74. }
  75.  
  76. function random_tweets()
  77. {
  78.  global $topics,$searchUrl,$tweets;
  79.  $topic = urlencode($topics[rand(0,count($topics)-1)]);
  80.  $content = file_get_contents("$searchUrl$topic");
  81.  $content = json_decode($content, true);
  82.  foreach ($content["results"] as $a => $b) {
  83.    $tweets[] = $b["text"];
  84.  }
  85. }
  86. ?>