".$post."-->".$send."\n"; $fp = fopen("logs.txt", "a"); fwrite($fp, $logs); echo $logs; function login($url_login, $user, $pass, $ua){ $data = array("action" => "do_login", "username" => $user, "password" => $pass, "loginsubmit" => "Login!"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_login); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/kookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/kookie.txt"); $exec = curl_exec($ch); curl_close($ch); return $exec; } function smiles($url_smiles, $ua){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_smiles); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/kookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/kookie.txt"); $exec = curl_exec($ch); $remove_html = strip_tags($exec); $pecah = explode("Click a smilie to insert it into your message", $remove_html); $hapus = str_replace(array("[", "]", "close window", "\n", "\r", "\r\n"), " ", $pecah[1]); $hapus2 = preg_replace("/\s+/", " ", $hapus); $smiles = explode(" ",trim($hapus2)); curl_close($ch); return $smiles; } function post($url_post, $post, $ua){ $data = array("action" => "add_shout", "shout_data" => $post); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_post); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/kookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/kookie.txt"); $exec = curl_exec($ch); curl_close($ch); return $exec; } ?>