나는 현재 Google에서 키워드 제안을 긁어 모으고 있습니다. 나는 그것을 테스트 할 때 어떤 이유로,긁어 모으기 키워드 제안 구글에서
["money",["moneygram","money network","money mutual","money trees lyrics","moneyball","moneypak","money","money converter","money order","money2india"]]
그러나 다음 URL을 통해 직접 액세스 할 때
<?php
function text_between($start,$end,$string) {
if ($start != '') {$temp = explode($start,$string,2);} else {$temp = array('',$string);}
$temp = explode($end,$temp[1],2);
return $temp[0];
}
function gsscrape($keyword) {
$keyword=str_replace(" ","+",$keyword);
global $kw;
$data=file_get_contents('http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&q='.$keyword);
$data=explode('[',$data,3);
$data=explode('],[',$data[2]);
foreach($data as $temp) {
$kw[]= text_between('"','"',$temp);
}
}
#simple to use, just use yourscriptname.php?keywords
if ($_SERVER['QUERY_STRING']!='') {
gsscrape($_SERVER['QUERY_STRING']);
foreach ($kw as $keyword) {
gsscrape($keyword);
}
//sorted and duplicates removed
sort(array_unique($kw));
#all results echoed with break
foreach ($kw as $keywords) {
echo $keywords. "<br />";
}
}
?>
구글이 나에게 키워드 money
이 응답을 줄 것이다 : 이것은 내가 함께 일하고 있어요 스크립트입니다 내 웹 사이트에서 다음과 같이 표시됩니다.
moneygram
moneygram
이렇게 각 키워드가 표시되도록 변경해야 할 사항은 무엇입니까?
moneygram, money network, money mutual, money trees lyrics, moneyball, moneypak, money, money converter, money order, money2india
당신은 http://scrape-google-suggest.compunect.com/ PHP 구글이 제안하는 오픈 소스입니다 을 확인해야합니다 : 배열이 사용으로
– John