利用Yahoo! Search API开发自已的搜索引擎

?php// Yahoo Web Services PHP Example Code// Rasmus Lerdorf// $appid =
”YahooDemo”;// 在这输入你申请的ID号$service = array(”image”=””,
”local”=””, ”news”=””, ”video”=””,
”web”=””);?htmlheadtitlePHP Yahoo Web Service Example
Code/title/headbodyform action=YahooSearchExample.php method=GETSearch
Term: input type=text name=query /br /Zip Code: input type=text name=zip
/ (for local search)br /input type=submit value= Go! /select
name=type?php foreach($service as $name = $val) {
if(!empty($_REQUEST[”type”]) $name == $_澳门新葡亰网站注册,REQUEST[”type”]) echo
option SELECTED$name/optionn; else echo option$name/optionn;}
?/select/form?phpfunction done()
{?/body/html?phpexit;}if(empty($_REQUEST[”query”]) ||
!in_array($_REQUEST[”type”],array_keys($service))) done();// Ok,
here we go, we have the query and the type of search is valid// First
build the query$q = ‘