<?php /** * Created by PhpStorm. * User: ec * Date: 04.07.2015 * Time: 21:52 */ require __DIR__ . '/../vendor/autoload.php'; echo "<pre>\n"; $url = 'http://bpteam.net/header.php'; //$url = 'http://m.torg.ua/kiev/kvartiry/sdam/1-komnatnye'; /** * @var \GetContent\cGetContent|\GetContent\cSingleCurl $getContent */ $getContent = new \GetContent\cGetContent('cSingleCurl'); $tor = new \GetContent\cTor(); $tor->setIpCountries('us'); var_dump($tor->start()); $getContent->setCheckAnswer(false); $getContent->setMinSizeAnswer(2); //$gc->setDefaultOption(CURLOPT_PORT,8888); var_dump($tor->getTorConnection()); $getContent->setUseProxy($tor->getTorConnection(), CURLPROXY_SOCKS5); $answer = $getContent->load($url); var_dump($getContent->getInfo()); var_dump($answer); echo "</pre>\n";
<?php /** * Created by PhpStorm. * User: ec * Date: 04.07.2015 * Time: 21:54 */ $ipPull = array('123.132.132.123', '132.132.132.123'); $url = 'icanhazip.com'; //$regEx = '%<td[^>]*>(<br\s*/>)*<strong\s*title="(?<title>[^"]*)">[^<]*</strong>(<br\s*/>)*</td>\s*<td[^>]*>(?<value>[^<]*)</td>%imsu'; echo "REAL IP IS " . implode(',', $ipPull); $tor = new \GetContent\cTor(); $tor->setIpCountries('ua'); $getContent = new \GetContent\cGetContent('cSingleCurl'); $getContent->setDefaultOption(CURLOPT_TIMEOUT, 90); var_dump($getContent->load($url)); $tor->start(); $getContent->setUseProxy($tor->getTorConnection(), CURLPROXY_SOCKS5); var_dump($getContent->load($url)); $tor->setIpCountries('ca'); $tor->restart(); var_dump($getContent->load($url)); $tor->setIpCountries(array('ua')); $tor->restart(); var_dump($getContent->load($url));