10-31-2014, 04:14 PM
proxy.class.php
curl.class.php
dom.class.php
http://*marked as SPAM*/muEDhXUq
Example
PHP Code:
<?php
require_once('curl.class.php');
require_once('dom.class.php');
class proxy
{
private $url = 'http://proxylist.hidemyass.com/';
private $file = 'proxy.txt';
function parse($data)
{
$data = preg_replace('/\.(.*?)\{display\:inline\}/', '', $data);
$data = preg_replace('/(\<div|\<span) style\=\"display\:none\"\>(.*?)(\<\/div\>|\<\/span\>)/', '', $data);
preg_match_all('/\.(.*?)\{display\:none\}/', $data, $page);
foreach ($page[1] as and$pages) {
$data = preg_replace('/class\=\"' . $pages . '\"/', 'style="display:none"', $data);
}
$data = preg_replace('/\<span style\=\"display:none\"\>(.*?)\<\/span\>/', '', $data);
return $data;
}
function grab_proxylist()
{
for ($i = 0; $i <= 4; $i++) {
$data = curl::visible($this->url.$i);
$data = $this->parse($data);
$html = file_get_content($data);
foreach ($html->find('.altshade') as $element) {
$ip = preg_replace('/\s/', '', $element->children(1)->plaintext);
$port = preg_replace('/\s/', '', $element->children(2)->plaintext);
$proxylist[] = $ip . ':' . $port;
}
}
return $proxylist;
}
function grab_proxy()
{
for ($i = 0; $i <= 4; $i++) {
$data = curl::visible($this->url.$i);
$data = $this->parse($data);
$html = file_get_content($data);
foreach ($html->find('.altshade') as $element) {
$ip = preg_replace('/\s/', '', $element->children(1)->plaintext);
$port = preg_replace('/\s/', '', $element->children(2)->plaintext);
$proxylist[] = $ip . ':' . $port;
}
$ran = array_rand($proxylist);
$proxy = $proxylist[$ran];
}
return $proxy;
}
}
curl.class.php
PHP Code:
<?php
class curl
{
private $url;
private $proxy;
public $error = true;
function hidden($url, $proxy)
{
global $error;
$proxy = explode(':', $proxy);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy[0]);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy[1]);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36');
curl_setopt($ch, CURLOPT_HEADER, 1);
if($error == true) {
echo 'error:' . curl_error($ch). PHP_EOL;
}
return curl_exec($ch);
}
function visible($url)
{
global $error;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36');
curl_setopt($ch, CURLOPT_HEADER, 1);
if($error == true) {
echo 'error:' . curl_error($ch). PHP_EOL;
}
return curl_exec($ch);
}
}
?>
dom.class.php
http://*marked as SPAM*/muEDhXUq
Example
PHP Code:
<?php/*
error_reporting(E_ALL);
ini_set('display_errors', '1');
*/
require_once('src/proxy.class.php');
$console = new proxy();
$proxy = $console->grab_proxy();
$data = curl::hidden('http://www.ipchicken.com/', $proxy);
echo $data;
?>