Advertisement
DraKiNs

Mass Retweet

Dec 13th, 2011
2,391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.94 KB | None | 0 0
  1. <?php  
  2. if(!$_POST[perfis])  {
  3. ?>
  4. <html>
  5. <title><b style="color:black;background-color:#ffff66">MassRetweet</b></title>
  6. <head>
  7.     <style type="text/css">
  8.         #btn
  9.             {
  10.                 background: transparent;
  11.                 border: solid thin;
  12.                 -moz-border-radius: 3px;
  13.                 -webkit-border-radius: 3px;
  14.                 border-radius: 3px;
  15.                 font-family: Verdana;
  16.                 width: 300px;
  17.             }
  18.         #follow
  19.             {
  20.                 background: transparent;
  21.                 border: solid thin;
  22.                 -moz-border-radius: 3px;
  23.                 -webkit-border-radius: 3px;
  24.                 border-radius: 3px;
  25.                 font-family: Verdana;
  26.             }
  27.         textarea
  28.             {
  29.                 width: 400px;
  30.                 height: 320px;
  31.             }
  32.         .work
  33.             {
  34.                 font-weight: bold;
  35.                 color: green;
  36.             }
  37.         .notwork
  38.             {
  39.                 font-weight: bold;
  40.                 color: red;
  41.             }
  42.         a
  43.             {
  44.                 color: #000000;
  45.                 font-weight: bold;
  46.             }
  47.     </style>
  48.     <script type="text/javascript">
  49.         function countFakes()
  50.             {
  51.                 document.getElementById("count").innerHTML =
  52.                     document.getElementById("perfis").value.split("\n").length;
  53.             }
  54.     </script>
  55. </head>
  56. <center>
  57. <form method="POST" action="">
  58. <textarea name="perfis" id="perfis" onkeydown="countFakes()" onchange="countFakes()"></textarea><br />
  59. <font id="count" style="font-weight: bold;">0</font>&nbsp;Perfis inseridos.<br /><br />
  60. <font face="Verdana">Id do Tweet</font><br />
  61. <input type="text" name="id" id="id" /><br /><br />
  62. <input type="submit" value="Retwittar" id="btn">
  63. </form>
  64. <?php
  65. } else {
  66. set_time_limit(0);
  67. Function Login ( $email, $password ) {
  68.  
  69. $ch = curl_init();
  70. curl_setopt_array($ch, Array(
  71.     CURLOPT_URL => 'https://mobile.twitter.com/session/new',
  72.     CURLOPT_SSL_VERIFYPEER => false,
  73.     CURLOPT_RETURNTRANSFER => true,
  74.     CURLOPT_HEADER => true));
  75. $response = curl_exec($ch);
  76.  
  77. preg_match("/_mobile_sess=[^\s]+/", $response, $_mobile_sess);
  78. preg_match("/name=\"authenticity_token\" type=\"hidden\" value=\"([^\"]+)/", $response, $authenticity_token);
  79.  
  80. curl_setopt_array($ch, Array(
  81.     CURLOPT_URL => 'https://mobile.twitter.com/session',
  82.     CURLOPT_RETURNTRANSFER => true,
  83.     CURLOPT_POST => true,
  84.     CURLOPT_COOKIE => $_mobile_sess[0],
  85.     CURLOPT_SSL_VERIFYPEER => false,
  86.     CURLOPT_POSTFIELDS => 'authenticity_token=' . $authenticity_token . '&username=' . trim(rawurlencode($email)) . '&password=' . trim(rawurlencode($password)),
  87.     CURLOPT_HEADER => true));
  88. $response = curl_exec($ch);
  89.  
  90. preg_match("/k=[^\s]+/", $response, $k);
  91. preg_match("/_mobile_sess=[^\s]+/", $response, $mobile);
  92. preg_match("/oauth_token=[^\s]+/", $response, $oauth);
  93.  
  94. curl_close($ch);
  95.  
  96.  
  97. return $k[0] . $mobile[0] . $oauth[0]; // retorna os cookies
  98.  
  99. }
  100.  
  101.  
  102. Function Unfollow ( $cookies, $id ) {
  103.  
  104. $ch = curl_init();
  105. curl_setopt_array($ch, Array(
  106.     CURLOPT_URL => 'http://mobile.twitter.com/',
  107.     CURLOPT_COOKIE => $cookies,
  108.     CURLOPT_RETURNTRANSFER => true));
  109. $response = curl_exec($ch);
  110.  
  111. preg_match("/name=\"authenticity_token\" type=\"hidden\" value=\"([^\"]+)/", $response, $authenticity);
  112.  
  113. curl_setopt_array($ch, Array(
  114.     CURLOPT_URL => "http://mobile.twitter.com/statuses/".$id."/retweet",
  115.     CURLOPT_RETURNTRANSFER => true,
  116.     CURLOPT_POST => true,
  117.     CURLOPT_REFERER => 'mobile.twitter.com/',
  118.     CURLOPT_COOKIE => $cookies,
  119.     CURLOPT_FOLLOWLOCATION => false,
  120.     CURLOPT_POSTFIELDS => 'authenticity_token=' .$authenticity[1]. '&authenticity_token=' . $authenticity[1]. '&x=1&y=8'));
  121. $response = curl_exec($ch);
  122. return $response; // precisa aplicar uma reg x pra ele retornar true ou false, dependendo do sucesso da ação
  123.  
  124.  
  125. }
  126.  
  127. $login = $_POST[perfis];
  128. $logins = explode("\n", $login);
  129. foreach ($logins as $perfil)
  130.             {
  131.                 $data = explode(":", $perfil);
  132.                 $usuario = trim($data[0]);
  133.                 $senha = trim($data[1]);
  134.                 $user = login($usuario, $senha);
  135. if(!preg_match("/auth/", $user)) {
  136. echo "<center><font color=\"red\">".$usuario." Login ou senha incorretos!</font><br>";
  137. } else {
  138.  
  139. echo "<center><b><font color=\"green\">".$usuario." </font>Deu Retweet!</b><br>";
  140. Unfollow($user, $_POST['id']);
  141.  
  142. }
  143. flush();
  144. ob_flush();
  145. sleep(1);
  146. }
  147.  
  148.  
  149.  
  150.  
  151. }
  152. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement