Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $proxyarray = array();
- $proxyinuse = 0;
- $proxy = $proxyarray[$proxyinuse];
- //$proxyauth = 'user:password';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_PROXY, $proxy);
- //curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- $fp = fopen("scraped.txt", "a");
- $url = 'http://mcbouncer.com/userbans';
- $numberofpages = curl_exec($ch);
- $regex = '/<a.*href="\?page=(.*)".*>Last<\/a>/';
- preg_match($regex,$numberofpages,$pagearray);
- print_r($pagearray);
- $page = $pagearray[1];
- $array = array();
- $reqs = 1;
- for($i = 1; $i <= $page; $i++){
- if($reqs == 5){
- $reqs = 0;
- $proxyinuse++;
- $proxy = $proxyarray[$proxyinuse];
- }
- $url = http://mcbouncer.com/userbans?page='.$i;
- $data = curl_exec($ch);
- $data = str_replace("<a", "\n<a", $data);
- $data = str_replace("</a>", "</a>\n", $data);
- $regex = '/<a.*href="\/user\/.*>(.*)<\/a>/';
- preg_match_all($regex,$data,$output);
- foreach($output[1] as $key => $val){
- if(!in_array($val, $array)){
- echo $val."\n\r";
- $array[] = $val;
- fwrite($fp, $val."\n");
- }
- }
- }
- curl_close($ch);
- fclose($fp);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment