Advertisement
Guest User

Waz-Warez - Link Checker

a guest
Apr 27th, 2010
1,338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.03 KB | None | 0 0
  1. <?php
  2. /// phpBB3 RS Link checker - Gavo
  3. /// add ?topic=1000 to start at topic number 1000
  4.  
  5.  
  6. /// Your Forums Graveyard ID
  7. $shittip="158";
  8.  
  9. // Sitename + Filename
  10. $scripturl="YOUR DOMAIN.ORG/CHECK.php";
  11.  
  12. // Amount Of Topics To Check In 1 Pass
  13. $posts="40";
  14.  
  15.  
  16.  
  17. // No More Edits Needed
  18.  
  19. require "config.php";
  20. $con = mysql_connect("$dbhost","$dbuser","$dbpasswd");
  21. if (!$con) { die('Cant Connect To DB' .mysql_error()); }
  22. mysql_select_db("$dbname", $con);
  23.  
  24. ?>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27.   <head>
  28.     <title>Link Checker</title>
  29.     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  30. <style type="text/css"><!--
  31. html, body {
  32.     margin: 0;
  33.     padding: 0;
  34. }
  35. body {
  36.     margin: 0;
  37.     font-family: 'Trebuchet MS', Verdana, Georgia, Arial, sans-serif;
  38.     font-size: 12px;
  39.     text-align: center;
  40.     color: #000;
  41.     line-height: 1.3em;
  42.     background-color: #001535;
  43.     background-image: url(linkchecker.gif);
  44.     background-repeat: repeat-x;
  45.     background-position: left top;
  46. }
  47. h1 {
  48.     font: bold small-caps 1.25em Georgia, "Times New Roman", Times, serif;
  49.     text-transform: uppercase;
  50.     color: #B05A04;
  51. }
  52. h2 {
  53.     font: small-caps 1em Georgia, "Times New Roman", Times, serif;
  54.     color: #B06E04;
  55. }
  56. p, a {
  57.     font: 0.9em Arial, Geneva, Helvetica, sans-serif;
  58.     color: #999;
  59. }
  60. #container {
  61.     min-height: 650px;
  62.     width: 670px;
  63.     margin: 0.5em auto 0.5em auto;
  64.     background: #fff;
  65.     text-align:center;
  66.     -moz-border-radius: 20px;
  67.     padding: 0.5em;
  68. }
  69. #container li {
  70.     float: left;
  71.     width: 150px;
  72.     height:150px;
  73.     list-style-type:none;
  74.     border: solid #ccc;
  75.     border-width: 1px 1px 0 0;
  76.     -moz-border-radius-topright:10px;
  77.     margin:1em;
  78.     text-align:center;
  79.     display:inline;
  80. }
  81. --></style>
  82.   </head>
  83. <script language="javascript">
  84. function pageScroll() {
  85.         window.scrollBy(0,400); // horizontal and vertical scroll increments
  86.         scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds
  87. }
  88. </script>
  89. <body>
  90.  
  91. <p><h1>Waz-Warez LinkBot - By Gavo</h1></p>
  92. <div id="container">
  93. <a href="javascript:pageScroll()">Scroll Page</a>
  94. <p onClick="pageScroll()" />
  95. <?php
  96.  
  97. $topic = mysql_real_escape_string($_GET['topic']);
  98.  
  99. for ($i=0;$i<=$posts;$i++) {
  100. $topic++;
  101. $live =0;
  102. $dead =0;
  103. $x=0;
  104.  
  105. $result = mysql_query('SELECT post_text FROM ' . $table_prefix . 'posts WHERE topic_id="'.$topic.'" AND forum_id NOT like"'.$shittip.'"') or die(mysql_error());
  106. if(mysql_num_rows($result) == 0) { echo "<h4>Post ID not found</h4>"; }
  107. else {
  108. while($row = mysql_fetch_array($result))
  109. {
  110. $text=$row['post_text'];
  111. $text = str_replace("["," ",$text);
  112. $text = str_replace("]"," ",$text);
  113. $text = str_replace("&#46;",".",$text);
  114. $text = str_replace("&#58;",":",$text);
  115. $text = htmlentities($text);
  116. }
  117. $alllinks = $text;
  118. $alllinks = explode(" ", $alllinks);
  119. $alllinks = implode("\n", $alllinks);
  120. $alllinks = explode("\n", $alllinks);
  121. $x = 1;
  122. foreach($alllinks as $link)
  123. {
  124. if(eregi("rapidshare.com/files/", $link)) {if ($dead>10 || $live>10) {echo"...";} else {rscheck($link , $x);$x++;}}
  125. }
  126.  
  127. if ($dead + $live == "0") {echo "".$topic." No Download Links or Already Binned<br />";}
  128. if ($dead < $live) {echo"Topic <h2><font color=\"green\">".$topic." OK</font></h2>";}
  129. if ($dead > $live) {global $topic;binit($topic);}
  130.  
  131. }
  132. }
  133. refresh_page ($topic);
  134. mysql_close($con);
  135. $con = null;
  136.  
  137.  
  138. function refresh_page($pid) {
  139. global $scripturl;
  140. echo "<meta http-equiv=\"refresh\" content=\"1;url=http://".$scripturl."?topic=".$pid."\">";
  141. }
  142.  
  143. function binit($tid) {
  144. global $shittip;
  145. global $table_prefix;
  146. echo "<h2> - BINNING - ".$tid."</h2>";
  147. mysql_query('UPDATE ' . $table_prefix . 'posts SET forum_id="' . $shittip . '" WHERE topic_id="' . $tid . '"');
  148. mysql_query('UPDATE ' . $table_prefix . 'topics SET forum_id="' . $shittip . '" WHERE topic_id="' . $tid . '"');
  149. mysql_query('UPDATE ' . $table_prefix . 'forums SET forum_posts = forum_posts + 1 WHERE forum_id ="' . $shittip . '"');
  150. mysql_query('UPDATE ' . $table_prefix . 'forums SET forum_topics = forum_topics + 1 WHERE forum_id ="' . $shittip . '"');
  151. }
  152.  
  153. function rscheck($link , $x)
  154. {
  155.     global $live;
  156.     global $dead;
  157.     $files_pattern= '/\/files\/([^\/]*)\//';
  158.     $filename_pattern= '/\/files\/.*\/(.*)/';
  159.     preg_match($files_pattern, $link, $matches_id);
  160.     preg_match($filename_pattern, $link, $matches_name);
  161.     $res= file_get_contents("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files={$matches_id[1]}&filenames={$matches_name[1]}");
  162.     list($fId,$fName,$fSize,$fServerId,$fStatus,$fShortHost,$fmd5) =explode(',',$res);
  163. if ($fStatus==1) {
  164.     echo"<span style='background-color:green;color:Black;font-size:8pt;text-align:left; margin: 1px 0px'>$x: Active:</span> <a href=\"$link\" target=\"_blank\">$link</a><br />\n";$live++;
  165.     }
  166. else {
  167.     echo "<span style='background-color: red; color:Black;font-size:8pt;text-align:left;margin:1px 0px'>$x: Dead:</span> <a href=\"$link\" target=\"_blank\">$link</a><br />\n";$dead++;
  168.     }
  169. }
  170. ?>
  171. </div>
  172. </body>
  173. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement