Skip to content

Instantly share code, notes, and snippets.

@josefnpat
Created November 4, 2011 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefnpat/1340055 to your computer and use it in GitHub Desktop.
Save josefnpat/1340055 to your computer and use it in GitHub Desktop.
Find stuff
<?php
//From Forum: marioR14.love
$bname = array("mario","mari0","");
$after = array("R","v","alpha","");
$exts = array(".zip",".love",".rar",".7z",".gz",".tar",".tgz");
$it = 100;
/*
$bname = array("mari0");
$after = array("R");
$exts = array(".love");
$it = 200;
*/
$bname = array("mario","mari0","");
$after = array("R","v","alpha","");
$exts = array(".zip",".love");
$it = 150;
$total = count($bname)*count($after)*count($exts)*($it+1);
$times = array();
$current = 0;
$done = array();
$s = "";
foreach($bname as $b){
foreach($after as $a){
foreach($exts as $e){
for($i = 0; $i <= $it; $i++){
$current++;
$start_time = microtime(1);
$c = @file_get_contents("http://stabyourself.net/stuff/$b$a$i$e");
$time = microtime(1) - $start_time;
if ($c == null){
for($j=0;$j<strlen($s);$j++){
echo chr(8);
}
$times[] = $time;
$s = round((array_sum($times)/count($times))*($total-$current))."s remain.[$current/$total] $b$a$i$e";
echo $s;
} else {
$s = "";
$f = "found: $b$a$i$e\n";
echo $f;
$done[] = $f;
}
}
}
}
}
echo "\n";
print_r($done);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment