Exemplo n.º 1
0
 protected function checkProxyArrayToSite($arrayProxy, $url, $checkWord, $chunk = 100)
 {
     if (!is_array($arrayProxy)) {
         return [];
     }
     $goodProxy = [];
     $this->loader->setCountStream(1);
     $this->loader->setTypeContent('text');
     $this->loader->setDefaultOption(CURLOPT_POST, false);
     $this->loader->setDefaultOption(CURLOPT_TIMEOUT, 30);
     $this->loader->setCheckAnswer(false);
     foreach (array_chunk($arrayProxy, $chunk) as $challenger) {
         $this->loader->setCountCurl(count($challenger));
         $descriptorArray =& $this->loader->getDescriptorArray();
         $urlList = [];
         foreach ($descriptorArray as $key => &$descriptor) {
             $this->loader->setOption($descriptor, CURLOPT_PROXY, $challenger[$key]['proxy']);
             $urlList[] = $url;
         }
         foreach ($this->loader->load($urlList) as $key => $answer) {
             $testCount = 0;
             $countGood = 0;
             foreach ($checkWord as $valueCheckWord) {
                 $testCount++;
                 if (preg_match($valueCheckWord, $answer)) {
                     $countGood++;
                 }
             }
             if ($countGood == $testCount) {
                 $goodProxy[] = $challenger[$key];
             }
         }
     }
     return count($goodProxy) ? $goodProxy : [];
 }
Exemplo n.º 2
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;
Exemplo n.º 3
0
 * Created by JetBrains PhpStorm.
 * User: ec
 * Date: 26.09.13
 * Time: 22:15
 * Project: GetContent
 * @author: Evgeny Pynykh bpteam22@gmail.com
 */
use bpteam\Loader\Loader;
use bpteam\DryText\DryPath;
use bpteam\ProxyList\ProxyUpdate;
return [];
$urlSource = "http://www.samair.ru/proxy/proxy-01.htm";
$nameSource = "samair.ru";
$curl = new Loader('LoaderSingleCurl');
$updateProxy = new ProxyUpdate();
$curl->setTypeContent("text");
$proxySamair = array();
do {
    $answerSamair = $curl->load($urlSource);
    if (!$answerSamair) {
        break;
    }
    if (!preg_match('%<script\\s*src="(?<jsFile>/js/\\d+.js)"\\s*type="text/javascript"></script>%imsu', $answerSamair, $jsFile)) {
        break;
    }
    $answerJs = $curl->load('http://www.samair.ru' . $jsFile);
    if (!preg_match_all('%<tr\\s*class="[^"]*"\\s*rel="\\d*">(?U)(?<proxyHtml>.*)</tr>%imsu', $answerSamair, $matchesHtml)) {
        break;
    }
    foreach ($matchesHtml['proxyHtml'] as $proxyHtml) {
        if (DryPath::isIp($proxyAddress)) {