|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Suggestion WordCategory : PHP Script
Pernah donk pake google, trus pernah salah ketik ga? sewaktu misalnya kita ketik "citra land" si google pasti akan memberikan kita sugggestion word, Did you mean "citraland"?. nah ini adalah script yang di gunakan untuk mengambil suggestion word dari google. aku memberikan 2 versi. satu lagi di ambil dari properspell.com, pada kenyataannya yang properspell.com harusnya lebih cepat karena cuma ambil suggestion word doank, yang google sekalian cariin hasil buat keyword yang kita masukin, untuk demo lihat disini :
ini source codeny, semoga berguna ![]() <? $keyword = urlencode("citra land mall"); $t1 = microtime(true); $url = "http://www.google.com.sg/search?hl=en&q=$keyword &btnG=Google+Search&meta="; $content = file_get_contents($url); if ($content) { preg_match('/<p><font color=#cc0000 class=p>Did you mean to search for: <\/font><a href=(.*) class=p>(.*)<\/a> <br>/i',$content,$match); if ($match) { echo $match[2]; } } echo "<br>".(microtime(true)-$t1); echo "<hr>"; $t1 = microtime(true); $url = "http://www.properspell.com/spellcheck/v5.0/check.php?id= DEMOKEY1&term=$keyword"; $content = file_get_contents($url); if ($content) { preg_match("/__lucien.display\('(.*)', '(.*)', '(.*)'\);/i",$content,$match); if ($match) { echo $match[2]; } } echo "<br>".(microtime(true)-$t1); ?> Facebook
<< Back 4 Comment
| 1274 hits | Posted by Callrid at 2007-09-07 14:07:32
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Last Modified
08-November-2011, 23:21:04 pm callrid.com Created 2006-2010 by Anton Ongsono All rights reserved |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||