Php 如何增加雅虎相关建议的回报规模
我有这段代码,它将使用api从yahoo返回关键字建议Php 如何增加雅虎相关建议的回报规模,php,api,yahoo,Php,Api,Yahoo,我有这段代码,它将使用api从yahoo返回关键字建议 function suggestion($keyword,$keyid){ $search_key= str_replace(' ','+',$keyword); $app ="D4FRJzjeHUCoJsYIeYV4E6XFUlJpX.o1TWALuI-"; $search = "http://search.yahooapis.com/WebSearchService/V1/relatedS
function suggestion($keyword,$keyid){
$search_key= str_replace(' ','+',$keyword);
$app ="D4FRJzjeHUCoJsYIeYV4E6XFUlJpX.o1TWALuI-";
$search = "http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=".$app."&query=".$search_key."&output=json";
$content= file_get_contents($search);
$json = json_decode($content);
foreach($json->ResultSet->Result as $string){
//insert to database
echo $string."<br />";
}
}
函数建议($keyword,$keyid){
$search_key=str_replace(“,+”,$keyword);
$app=“D4FRJzjeHUCoJsYIeYV4E6XFUlJpX.o1TWALuI-”;
$search=”http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=“$app.”&query=“.$search\u key.”&output=json”;
$content=file\u get\u contents($search);
$json=json_解码($content);
foreach($json->ResultSet->Result as$string){
//插入到数据库
echo$string。“
”;
}
}
但它只返回4个关键字建议。
我尝试在搜索中添加&results=30,但运气不佳,它仍然只返回4个关键字建议。
非常感谢。阅读文档
它将在一个月内关闭,为什么现在还要麻烦使用它呢。这听起来像是在yahoo API文档中寻找的东西