<?php
/**
* WiseLoop PHP Web Grabber Sample<br/>
* Title: Proxy Test
* Description: Proxy Feature Test
* This is a Proxy test project: tests if a given IP list can be used as proxy.
*/
$proxies = wlExtArray::getArrayValue($_POST, "proxies", wlExtArray::getArrayValue($_GET, "proxies", null));
?>
<!-- form start -->
<form action="" id="form" method="POST" enctype="multipart/form-data" class="form-horizontal" role="form">
<input type="hidden" id="demo" name="demo" value="proxy"/>
<div class="form-group">
<label for="q" class="col-sm-2 control-label">Proxy list:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="proxies" id="proxies" placeholder="xxx.xxx.xxx.xxx:port, xxx.xxx.xxx.xxx:port, xxx.xxx.xxx.xxx:port" value="<?php echo isset($proxies) ? htmlentities($proxies) : ""; ?>"/>
<span class="help-block">(separate proxies by comma, proxy should be in the form xxx.xxx.xxx.xxx:port)</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" value="Grab" class="btn btn-primary"/>
</div>
</div>
</form>
<!-- form end -->
<?php
$url = 'http://checkip.dyndns.org/';
$p1 = new wlWgParam('');
$wc = new wlWgProcessor(
$url,
$p1,
0
);
$wc->setProxyList($proxies);
if ($url) {
//$wc->draw();
$result = $wc->get();
echo '<div class="well well-small">';
echo '<h3 class="color-caption">Grabbed content from <a style="font-weight:bold;" target="_blank" href="' . $url . '">' . $url . '</a></h4>';
echo $result[0][0];
echo '</div>';
}