function getSearch($uel){ $cookieFile = "cookies.txt"; if(!file_exists($cookieFile)) { $fh = fopen($cookieFile, "w"); fwrite($fh, ""); fclose($fh); } $cari=rawurlencode($uel); $url="https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=$cari"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"); $data = curl_exec($ch); $js=json_decode($data); $outpx = ""; $d=array(); if (count($js)>0){ if ($js->responseData!=null){ $outpx = "<ul>"; foreach($js->responseData->results as $a){ $d[]=array("judul"=>str_replace("</b>","",str_replace("<b>","", $a->title)), "isi"=>$a->content."<br/>url:"."<a href='".$a->url."'>".$a->url."</a>"); $outpx.= "<li><a href='".$a->url."'>".$a->title."</a><p>".$a->content."</p></li>"; //posting(str_replace("</b>","",str_replace("<b>","", $a->title)),$a->content."<br/>url:"."<a href='".$a->url."'>".$a->url."</a>"); } posting($d); $outpx .="</ul>"; } } return $outpx; }
Home » Related Words
Related Words
Langkah selanjutnya adalah membuat related keywords
Subscribe to:
Posts (Atom)
0 comments:
Post a Comment