& Nbsp; on February 23, March 1, Yang Zhiyuan, co-founder of Yahoo, will announce that the company's search network will enter Web services. Yahoo! has established the yahoosearchpipeline network on www.developer.yahoo.com. The company plans to hold the search engine strategy conference (Se
Yang Zhiyuan, co-founder of Yahoo!, will announce that the company's search network will enter Web services on July 15, March 1. Yahoo! has established the Yahoo Search Developer Network on www.developer.yahoo.com. The company plans to launch this plan at the Search Engine Strategies Conference held in New York. This network will allow developers to create new applications for Yahoo search, including images, videos, news, and regional searches. Members who want to use this service must first go to the http://api.search.yahoo.com/webservices/register_application to apply for a self-idnumber, note: Each idnumber can only search 5000 times a day.
Next, let's take a look at how to use php (as the mainstream development language) scripts to call Yahoo! Search by using the Search API. all scripts are as follows:
// Yahoo Web Services php (as the mainstream development language) Example Code
// Rasmus Lerdorf
// Www.acnow.net
$ Appid = YahooDemo;
// Enter your ID number here
$ Service = array (image => http://api.search.yahoo.com/ImageSearchService/V1/imageSearch,
Http://api.local.yahoo.com/LocalSearchService/V1/localSearch,
News => http://api.search.yahoo.com/NewsSearchService/V1/newsSearch,
Http://api.search.yahoo.com/VideoSearchService/V1/videoSearch,
Web => http://api.search.yahoo.com/WebSearchService/V1/webSearch );
?>
Php (as the mainstream development language) Yahoo Web Service Example Code
Function done () {?>
Exit;
}
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 =? Query =. rawurlencode ($ _ REQUEST [query]);
If (! Empty ($ _ REQUEST [zip]) $ q. = "& zip =". $ _ REQUEST [zip];
If (! Empty ($ _ REQUEST [start]) $ q. = "& start =". $ _ REQUEST [start];
$ Q. = "& appid = $ appid ";
// Then send it to the appropriate service
$ Xml (standardization is getting closer and closer) = file_get_contents ($ service [$ _ REQUEST [type]. $ q );
// Parse the xml (standardization is getting closer and closer) and check it for errors
If (! $ Dom = domxml (standardization is getting closer and closer) _ open_mem ($ xml (standardization is getting closer and closer), DOMxml (standardization is getting closer and closer) _ LOAD_PARSING, $ error )){
Echo "xml (standardization is getting closer and closer) parse error ";
Foreach ($ error as $ errorline ){
/* For production use this shocould obviusly be logged to a file instead */