Example #1
0
$curl->setTypeContent("html");
$proxyHidemyass = array();
do {
    $answerHidemyass = $curl->load($urlSource);
    if (!$answerHidemyass) {
        break;
    }
    if (preg_match_all('%<tr\\s*class="[^"]*"\\s*rel="\\d*">(?U)(?<proxyHtml>.*)</tr>%imsu', $answerHidemyass, $matchesHtml)) {
        foreach ($matchesHtml['proxyHtml'] as $proxyHtml) {
            preg_match_all('%\\.(?<class>[\\w_-]+){display\\:\\s*inline\\s*}%imsu', $proxyHtml, $matchesClass);
            $needClass = implode('|', $matchesClass['class']);
            preg_match_all('%(<(span|div)\\s*(style\\s*=\\s*"\\s*display\\s*\\:\\s*inline\\s*"|class\\s*=\\s*"(\\d+|' . $needClass . ')")\\s*>\\s*([^<>]+)\\s*|</(span|div|style)>\\s*([^"<>]+)\\s*)%imsu', $proxyHtml, $matchesProxy);
            preg_match('%</td>\\s*<td>\\s*(?<port>\\d+)\\s*</td>%imsu', $proxyHtml, $matchPort);
            $proxyAddress = implode('', $matchesProxy[0]) . ':' . $matchPort['port'];
            $proxyAddress = preg_replace('%<[^<>]*>%imsu', '', $proxyAddress);
            $proxyAddress = preg_replace('%\\s+%ms', '', $proxyAddress);
            $proxyAddress = trim($proxyAddress);
            if (DryPath::isIp($proxyAddress)) {
                $proxyHidemyass[] = $proxyAddress;
            }
        }
    }
    if (preg_match('%<a\\s*href="(?<next>[^"]+)"\\s*class="next">%imsu', $answerHidemyass, $matchNext)) {
        $urlSource = "http://proxylist.hidemyass.com" . $matchNext['next'] . '#listable';
    } else {
        unset($urlSource);
    }
    sleep(rand(1, 3));
} while (isset($urlSource));
$updateProxy->saveSource($nameSource, $proxyHidemyass);
return $proxyHidemyass;
Example #2
0
 * User: EC
 * Date: 14.05.13
 * Time: 3:26
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\DryText\DryHtml;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = "http://xseo.in/freeproxy";
$nameSource = "xseo.in";
/**
 * @var Loader|\bpteam\Loader\LoaderSingleCurl $curl
 */
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setTypeContent("html");
$curl->setDefaultOption(CURLOPT_POST, true);
$curl->setDefaultOption(CURLOPT_POSTFIELDS, 'submit=%CF%EE%EA%E0%E7%E0%F2%FC+%EF%EE+100+%EF%F0%EE%EA%F1%E8+%ED%E0+%F1%F2%F0%E0%ED%E8%F6%E5');
$answerXseo = $curl->load($urlSource);
$proxyXseoProxy = array();
$answerXseo = DryHtml::betweenTag($answerXseo, '<table width="100%" BORDER=0 CELLPADDING=0 CELLSPACING=1>', false);
$ips = DryPath::getIp($answerXseo);
if ($ips) {
    foreach ($ips as $value_xseo) {
        $proxyXseoProxy[] = trim($value_xseo);
    }
}
$updateProxy->saveSource($nameSource, $proxyXseoProxy);
return $proxyXseoProxy;
Example #3
0
 /**
  * @param bool|string $proxy
  * @return bool
  */
 protected function setProxy($proxy)
 {
     switch ((bool) $proxy) {
         case true:
             if (is_string($proxy)) {
                 if (DryPath::isIp($proxy)) {
                     $this->options['proxy'] = 'tcp://' . $proxy;
                     //$this->setOption('request_fulluri', true);
                 }
             }
             break;
         default:
             $this->unSetOption('proxy');
             //$this->unSetOption('request_fulluri');
     }
     return (bool) $proxy;
 }
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: EC
 * Date: 14.05.13
 * Time: 2:36
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Curl\SingleCurl;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
return array();
$urlSource = "http://checkerproxy.net/all_proxy";
$nameSource = "checkerproxy.net";
$curl = new SingleCurl();
$updateProxy = new ProxyUpdate();
$answerCheckerProxy = $curl->load($urlSource);
$proxyCheckerProxy = [];
$ips = DryPath::getIp($answerCheckerProxy);
if ($ips) {
    foreach ($ips as $valueCheckerProxy) {
        $valueCheckerProxy = trim($valueCheckerProxy);
        if (DryPath::isIp($valueCheckerProxy)) {
            $proxyCheckerProxy[] = $valueCheckerProxy;
        }
    }
}
$updateProxy->saveSource($nameSource, $proxyCheckerProxy);
return $proxyCheckerProxy;
Example #5
0
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = "http://www.cool-proxy.net/proxies/http_proxy_list/page:";
$nameSource = "cool-proxy.net";
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setTypeContent("html");
$i = 1;
if (!($content = $curl->load($urlSource . $i . "/sort:working_average/direction:asc"))) {
    return [];
}
$countPage = preg_match_all('#/proxies/http_proxy_list/sort:working_average/direction:asc/page:(?<pagination>\\d*)"#iUm', $content, $matches) ? max($matches['pagination']) : 0;
$proxyCoolProxy = array();
do {
    if ($countProxy = preg_match_all('#<td\\s*style=\\"text.align.left.\\s*font.weight.bold.\\"><script type="text/javascript">document\\.write\\(Base64\\.decode\\("(?<ip_base64>.*)"\\)\\)</script></td>\\s*<td>(?<port>\\d+)</td>#iUms', $content, $matches)) {
        for ($j = 0; $j < $countProxy; $j++) {
            $is_ip = base64_decode($matches['ip_base64'][$j]) . ":" . $matches['port'][$j];
            if (DryPath::isIp($is_ip)) {
                $proxyCoolProxy[] = trim($is_ip);
            }
        }
    }
    $i++;
    sleep(rand(1, 3));
    $content = $curl->load($urlSource . $i . "/sort:working_average/direction:asc");
} while ($i <= $countPage);
$updateProxy->saveSource($nameSource, $proxyCoolProxy);
return $proxyCoolProxy;
Example #6
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: EC
 * Date: 14.05.13
 * Time: 3:35
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = __DIR__ . "/../proxy_list/source/import.page";
$nameSource = "import";
$updateProxy = new ProxyUpdate();
$fh = fopen($urlSource, 'r');
while ($answer = fgets($fh)) {
    $ips = DryPath::getIp($answer);
    if ($ips) {
        foreach ($ips as $value) {
            $value = trim($value);
            if (DryPath::isIp($value)) {
                $proxy[] = $value;
            }
        }
    }
}
$updateProxy->saveSource($nameSource, $proxy);
return $proxy;
Example #7
0
 * Date: 14.05.13
 * Time: 3:35
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = "http://www.cool-tests.com/all-working-proxies.php";
$nameSource = "cool-tests.com";
/**
 * @var Loader|bpteam\Loader\LoaderSingleCurl $curl
 */
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setEncodingAnswer(true);
$curl->setEncodingName('UTF-8');
$curl->load('http://www.cool-tests.com');
$curl->setTypeContent("html");
$curl->setDefaultOption(CURLOPT_REFERER, 'http://www.cool-tests.com');
$answerCoolTests = $curl->load($urlSource);
$proxyCoolTestsProxy = [];
$ips = DryPath::getIp($answerCoolTests);
if (!$ips) {
    return [];
}
foreach ($ips as $valueCoolTests) {
    $proxyCoolTestsProxy[] = trim($valueCoolTests);
}
$updateProxy->saveSource($nameSource, $proxyCoolTestsProxy);
return $proxyCoolTestsProxy;
Example #8
0
 /**
  * Переделать или делать запрос на другой сервис
  * @param $ip
  * @return void
  */
 public function setServerIp($ip)
 {
     if (!$ip) {
         $answer = file_get_contents($this->getUrlCheckServerIp());
         $ip = DryPath::getIp($answer);
         if (!isset($ip[0]) || !$ip[0]) {
             exit('NO SERVER IP');
         }
         $this->setServerIp($ip[0]);
     } else {
         $this->serverIp = $ip;
     }
 }
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = "http://gatherproxy.com/subscribe/login";
$nameSource = "gatherproxy.com";
$proxyGatherproxyProxy = [];
/**
 * @var Loader|\bpteam\Loader\LoaderSingleCurl $curl
 */
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setDefaultOption(CURLOPT_REFERER, 'http://gatherproxy.com/subscribe/login');
$curl->setTypeContent("html");
$curl->setDefaultOption(CURLOPT_POSTFIELDS, 'Username=zking.nothingz@gmail.com&Password=)VQd$x;7');
$answerGatherproxy = $curl->load($urlSource);
if (!preg_match('%<a\\s*href="(?<url>[^"]+)">Download\\s*fully\\s*\\d+\\s*proxies</a>%ims', $answerGatherproxy, $match)) {
    return $proxyGatherproxyProxy;
}
$curl->setDefaultOption(CURLOPT_REFERER, 'http://gatherproxy.com/subscribe/infos');
$answerGatherproxy = $curl->load('http://gatherproxy.com' . $match['url']);
$ips = DryPath::getIp($answerGatherproxy);
if ($ips) {
    foreach ($ips as $valueGatherproxy) {
        $proxyGatherproxyProxy[] = trim($valueGatherproxy);
    }
}
$updateProxy->saveSource($nameSource, $proxyGatherproxyProxy);
return $proxyGatherproxyProxy;
Example #10
0
 protected function configOption(&$descriptor, $option, $value)
 {
     switch ($option) {
         case CURLOPT_POST:
             if ($value != NULL) {
                 $descriptor['option'][$option] = (bool) $value;
             }
             if (!$descriptor['option'][$option] && isset($descriptor['option'][CURLOPT_POSTFIELDS])) {
                 unset($descriptor['option'][CURLOPT_POSTFIELDS]);
             }
             break;
         case CURLOPT_POSTFIELDS:
             if (!$value) {
                 unset($descriptor['option'][$option]);
                 $this->setOption($descriptor, CURLOPT_POST, false);
             } else {
                 $this->setOption($descriptor, CURLOPT_POST, true);
             }
             break;
         case CURLOPT_URL:
             $urlInfo = DryPath::parseUrl($value);
             if (isset($urlInfo['scheme']) && $urlInfo['scheme'] != $this->scheme) {
                 $this->setScheme($urlInfo['scheme']);
             }
             break;
         case CURLOPT_PROXY:
             if (DryPath::isIp($value)) {
                 $this->useProxy = true;
             }
             break;
         default:
             break;
     }
 }
Example #11
0
 protected function setOptionProxy()
 {
     if ($this->getUseProxy()) {
         if (is_object($this->proxy)) {
             $proxy = $this->proxy->getProxy($this->getKey(), $this->getUrl());
             if (is_string($proxy['proxy']) && DryPath::isIp($proxy['proxy'])) {
                 $this->setOption(self::PROXY, $proxy['proxy']);
                 $this->setOption(self::PROXY_TYPE, $proxy['protocol']);
             }
         } elseif (is_string($this->proxy['proxy'])) {
             $this->setOption(self::PROXY, $this->proxy['proxy']);
             $this->setOption(self::PROXY_TYPE, $this->proxy['type']);
             $this->setOption(self::PROXY_AUTH, $this->proxy['auth']);
         }
     } elseif ($this->getOption('proxy') !== null) {
         $this->setOption(self::PROXY, null);
         $this->setOption(self::PROXY_TYPE, null);
         $this->setOption(self::PROXY_AUTH, null);
     }
 }
$httpHead = array('Host: 2freeproxy.com', 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0', 'Accept: application/json, text/javascript, */*; q=0.01', 'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With: XMLHttpRequest', 'Referer: http://2freeproxy.com/anonymous-proxy.html', 'Content-Length: 14', 'Connection: keep-alive', 'Pragma: no-cache', 'Cache-Control: no-cache');
$curl->setDefaultOption(CURLOPT_HTTPHEADER, $httpHead);
$curl->setDefaultOption(CURLOPT_REFERER, 'http://2freeproxy.com/anonymous-proxy.html');
$curl->setDefaultOption(CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0');
$curl->setDefaultOption(CURLOPT_POST, true);
$curl->setDefaultOption(CURLOPT_POSTFIELDS, 'type=anonymous');
$answerTwofreeproxy = $curl->load($urlSource);
$tmpProxyArray = array();
if ($answerTwofreeproxy) {
    $tmpJsonProxy = json_decode($answerTwofreeproxy, true);
    $tmpProxyArray = explode('<br>', $tmpJsonProxy['proxy']);
}
$httpHead = array('Host: 2freeproxy.com', 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0', 'Accept: application/json, text/javascript, */*; q=0.01', 'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With: XMLHttpRequest', 'Referer: http://2freeproxy.com/elite-proxy.html', 'Content-Length: 10', 'Connection: keep-alive', 'Pragma: no-cache', 'Cache-Control: no-cache');
$curl->setDefaultOption(CURLOPT_HTTPHEADER, $httpHead);
$curl->setDefaultOption(CURLOPT_REFERER, 'http://2freeproxy.com/elite-proxy.html');
$curl->setDefaultOption(CURLOPT_POST, true);
$curl->setDefaultOption(CURLOPT_POSTFIELDS, 'type=elite');
$answerTwofreeproxy = $curl->load($urlSource);
$tmpProxyArray2 = array();
if ($answerTwofreeproxy) {
    $tmpJsonProxy = json_decode($answerTwofreeproxy, true);
    $tmpProxyArray2 = explode('<br>', $tmpJsonProxy['proxy']);
}
$tmpProxyNew = array_merge($tmpProxyArray2, $tmpProxyArray);
foreach ($tmpProxyNew as $valuePoststar) {
    if (DryPath::isIp(trim($valuePoststar))) {
        $proxyTwofreeproxyProxy[] = trim($valuePoststar);
    }
}
$updateProxy->saveSource($nameSource, $proxyTwofreeproxyProxy);
return $proxyTwofreeproxyProxy;
Example #13
0
/**
 * Created by JetBrains PhpStorm.
 * User: EC
 * Date: 14.05.13
 * Time: 2:36
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\DryText\DryHtml;
use bpteam\ProxyList\ProxyUpdate;
$urlSource = "http://www.poststar.ru/proxy.htm";
$nameSource = "poststar.ru";
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setTypeContent("html");
$answerPoststar = $curl->load($urlSource);
$answerPoststar = DryHtml::betweenTag($answerPoststar, '<table width="730" border="0" align="center">');
$proxyPoststarProxy = [];
$ips = DryPath::getIp($answerPoststar);
if ($ips) {
    foreach ($ips as $valuePoststar) {
        $valuePoststar = trim($valuePoststar);
        if (DryPath::isIp($valuePoststar)) {
            $proxyPoststarProxy[] = $valuePoststar;
        }
    }
}
$updateProxy->saveSource($nameSource, $proxyPoststarProxy);
return $proxyPoststarProxy;
Example #14
0
 public function get($domain)
 {
     return $this->find(DryPath::getDomainName($domain));
 }
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: EC
 * Date: 14.05.13
 * Time: 3:35
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
//return array();
$urlSource = "http://stopinfection.narod.ru/Proxy.htm";
$nameSource = "stopinfection.narod.ru";
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setEncodingAnswer(true);
$curl->setEncodingName('UTF-8');
$curl->setTypeContent("html");
$answerStopinfection = $curl->load($urlSource);
$proxyStopinfectionProxy = [];
if ($answerStopinfection && ($ips = DryPath::getIp($answerStopinfection))) {
    foreach ($ips as $valueStopinfection) {
        $proxyStopinfectionProxy[] = trim($valueStopinfection);
    }
}
$updateProxy->saveSource($nameSource, $proxyStopinfectionProxy);
return $proxyStopinfectionProxy;
Example #16
0
 * User: EC
 * Date: 14.05.13
 * Time: 3:35
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\DryText\DryHtml;
use bpteam\ProxyList\ProxyUpdate;
return array();
$urlSource = "http://spys.ru/aproxy/";
$nameSource = "spys.ru";
/**
 * @var Loader|\bpteam\Loader\LoaderSingleCurl $curl
 */
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setTypeContent("html");
$curl->setDefaultOption(CURLOPT_POST, true);
$curl->setDefaultOption(CURLOPT_POSTFIELDS, 'sto=%CF%EE%EA%E0%E7%E0%F2%FC+200');
$answerSpys = $curl->load($urlSource);
$answerSpys = DryHtml::betweenTag($answerSpys, '<table width="100%" BORDER=0 CELLPADDING=1 CELLSPACING=1>');
$ips = DryPath::getIp($answerSpys);
if ($ips) {
    foreach ($ips as $valueSpys) {
        $proxySpysProxy[] = trim($valueSpys);
    }
}
$updateProxy->saveSource($nameSource, $proxySpysProxy);
return $proxySpysProxy;
Example #17
0
 protected function loadList(&$proxyList, $proxySource)
 {
     foreach (explode("\n", $proxySource) as $challenger) {
         if (DryPath::isIp($challenger)) {
             $proxyList['content'][$challenger]['proxy'] = $challenger;
         }
     }
 }