function find_tags($keyword, $content) {
$content=preg_replace('|]*>|',' ',"$keywordn$content");$content=preg_replace('|s{2,}|',' ',$content); $url = "http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction";
$post = array('appid'=>'YahooDemo', 'context'=>$content, 'query'=>$keyword, 'output'=>'php'); Hopefully the information presented so far has been applicable. You might also want to consider the following:
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec ($ch);
curl_close ($ch); $results = unserialize($response);
$tags = @array_merge(explode(',',$tags), $results['ResultSet']['Result']); @array_walk($tags, create_function('&$value','$value = ucwords(trim($value));')); $tags = @array_unique($tags); if(@in_array('',$tags)){
unset($tags[array_search('',$tags)]);
} return $tags;
}
Unfortunately, it frequently pulls rear too a lot of tags so to efficiently use it by means of pingcrawl, optimistic require to trim the catalog somehow.
0 comments:
Post a Comment