Professional Documents
Culture Documents
php
function get($url,$host){
return curl($url,'',head($host))[1];
}
function post($url,$data,$host){
return curl($url,$data,head($host))[1];
}
function head($host){
$user=json_decode(file_get_contents("data.json"),true)["User"];
$cookie=json_decode(file_get_contents("data.json"),true)["Cookie"];
$h[]="Host: $host";
$h[]="content-type: application/x-www-form-urlencoded";
$h[]="user-agent: $user";
$h[]="cookie: $cookie";
return $h;
}
if(!file_exists("data.json")){
while("true"){
system("clear");
//ban();
$api["Cookie"]=readline("\033[1;97mInput Your Cookie : \033[1;92m");
if($api["Cookie"]!=""){
break;
}
}
while("true"){
system("clear");
//ban();
$api["User"]=readline("\033[1;97mInput Your User-agent : \033[1;92m");
if($api["User"]!=""){
break;
}
}
save("data.json",$api);
//$a=next($ran);
}
function save($data,$data_post){
if(!file_get_contents($data)){
file_put_contents($data,"[]");}
$json=json_decode(file_get_contents($data),1);
$arr=array_merge($json,$data_post);
file_put_contents($data,json_encode($arr,JSON_PRETTY_PRINT));
}
function timer($t){
$timr=time()+$t;
while(true):
echo "\r \r";
$res=$timr-time();
if($res < 1){break;}
if($res==$res){
// $str= str_repeat("\033[1;92m◼",$res)." \r";
}
echo " \033[1;97mPlease Wait \033[1;91m".date('i:s',$res)." ";
sleep(1);
endwhile;
}
function slow($str,$t){
$arr = str_split($str);
foreach ($arr as $az){
echo $az;
usleep($t);
}
}