Advertisement
plas71k

@blogers file 2 => decoded

Feb 17th, 2013
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.72 KB | None | 0 0
  1. <?php
  2. /*
  3.  * @ Pirate-Sky Crew :: PHP Decoder v2
  4.  * @ Author: pLa$71k
  5.  * @ Web: http://pirate-sky.com
  6.  * @ Pirate-Sky Crew © 2008 - 2013
  7.  */
  8.  
  9. function exx($start, $end, $content)
  10. {
  11.     if ($content && $start && $end) {
  12.         $r = explode($start, $content);
  13.         if (isset($r[1])) {
  14.             $r = explode($end, $r[1]);
  15.             return $r[0];
  16.         }
  17.         return "";
  18.     }
  19. }
  20.  
  21. function disguise_curl($url)
  22. {
  23.     $curl      = curl_init();
  24.     $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
  25.     $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
  26.     $header[] = "Cache-Control: max-age=0";
  27.     $header[] = "Connection: keep-alive";
  28.     $header[] = "Keep-Alive: 300";
  29.     $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  30.     $header[] = "Accept-Language: en-us,en;q=0.5";
  31.     $header[] = "Pragma: ";
  32.     curl_setopt($curl, CURLOPT_URL, $url);
  33.     curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 compatible RSS Fetcher");
  34.     curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  35.     curl_setopt($curl, CURLOPT_REFERER, "-");
  36.     curl_setopt($curl, CURLOPT_ENCODING, "gzip,deflate");
  37.     curl_setopt($curl, CURLOPT_AUTOREFERER, true);
  38.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  39.     curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 120);
  40.     curl_setopt($curl, CURLOPT_TIMEOUT, 120);
  41.     curl_setopt($curl, CURLOPT_MAXREDIRS, 5);
  42.     $html = curl_exec($curl);
  43.     curl_close($curl);
  44.     return $html;
  45. }
  46.  
  47. function unhtmlentities($string)
  48. {
  49.     $string    = preg_replace("~&#x([0-9a-f]+);~ei", "chr(hexdec(\"\\1\"))", $string);
  50.     $string    = preg_replace("~&#([0-9]+);~e", "chr(\"\\1\")", $string);
  51.     $trans_tbl = get_html_translation_table(HTML_ENTITIES);
  52.     $trans_tbl = array_flip($trans_tbl);
  53.     return strtr($string, $trans_tbl);
  54. }
  55.  
  56. function Get($varId)
  57. {
  58.     $file_name = cache_folder . $varId;
  59.     if (file_exists($file_name)) {
  60.         $fileHandler    = fopen($file_name, "r");
  61.         $varValueResult = fread($fileHandler, filesize($file_name));
  62.         fclose($fileHandler);
  63.         return unserialize($varValueResult);
  64.     }
  65.     return FALSE;
  66. }
  67.  
  68. function Set($varId, $varValue)
  69. {
  70.     Delete($varId);
  71.     $fileHandler = fopen(cache_folder . $varId, "a");
  72.     if (fwrite($fileHandler, serialize($varValue))) {
  73.         return true;
  74.     }
  75.     fclose($fileHandler);
  76.     return false;
  77. }
  78.  
  79. function Delete($varId)
  80. {
  81.     $file_name = cache_folder . $varId;
  82.     if (file_exists($file_name)) {
  83.         @unlink($file_name);
  84.     }
  85. }
  86.  
  87. function get_feeds($sourceUrl, $sourceName, $max = false)
  88. {
  89.     global $query;
  90.     global $jobLocation;
  91.     global $lang;
  92.     global $related;
  93.     $has_curl  = function_exists("curl_init");
  94.     $has_iconv = function_exists("iconv");
  95.     $target    = $has_curl ? disguise_curl($sourceUrl) : file_get_contents($sourceUrl);
  96.     $target    = $has_iconv ? iconv("UTF-8", "UTF-8//TRANSLIT", $target) : $target;
  97.     $i         = 1;
  98.     $deneme    = explode("<item>", $target);
  99.     $count     = count($deneme) - 1;
  100.     if (0 < $count) {
  101.         $count = !empty($max) ? $max : $count;
  102.     }
  103.     $count = _maxlisting < $count ? 20 : $count;
  104.     if ($count == 0) {
  105.         echo "";
  106.     } else {
  107.         while (!$related && $i <= $count) {
  108.             $aud                 = explode("<item>", $target);
  109.             $aud                 = explode("</item>", $aud[$i]);
  110.             $aud[0]              = str_replace(array(
  111.                 "<![CDATA[",
  112.                 "]]>"
  113.             ), array(
  114.                 "",
  115.                 ""
  116.             ), $aud[0]);
  117.             $title               = exx("<title>", "</title>", $aud[0]);
  118.             $link                = exx("<link>", "</link>", $aud[0]);
  119.             $description         = exx("<description>", "</description>", $aud[0]);
  120.             $date                = exx("<pubDate>", "</pubDate>", $aud[0]);
  121.             $info['title']       = $title;
  122.             $info['link']        = $link;
  123.             $info['description'] = $description;
  124.             $info['date']        = $date;
  125.             $info['source_name'] = $sourceName;
  126.             $info['query']       = $query;
  127.             $info['location']    = $jobLocation;
  128.             if (set(md5($link), $info) && !$related) {
  129.                 include("layout/rss-item.php");
  130.             }
  131.             ++$i;
  132.         }
  133.     }
  134. }
  135.  
  136. function parse($countrySelect, $query, $jobLocation, $max)
  137. {
  138.     $directory = "includes/sources/" . $countrySelect . "/";
  139.     $sources   = glob($directory . "*");
  140.     foreach ($sources as $source) {
  141.         if (substr($source, 0 - 4) == ".php") {
  142.             require($source);
  143.             get_feeds($sourceUrl, $sourceName, $max, $related);
  144.         }
  145.     }
  146. }
  147.  
  148. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement