테스트 사이트 - 개발 중인 베타 버전입니다

[1원팁] 네이버 실시간 검색어 20개 추출

· 7년 전 · 8544 · 20

[code]

 

function NaverKeyWord(){
    $Curl = curl_init();
    curl_setopt($Curl, CURLOPT_URL, "https://datalab.naver.com/keyword/realtimeList.naver?where=main");
    curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($Curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    $Result = curl_exec($Curl);
    $RandList = explode("<ul class=\"rank_list\">", $Result);
    $RandList = explode("</ul>", $RandList[1]);
    $Rand[0] = explode("<span class=\"title\">", $RandList[0]);
    for($i=1; $i < count($Rand[0]); $i++){
    $Rand[1] = explode("</span>", $Rand[0][$i]);
        $ReturnData = trim(strip_tags($Rand[1][0]));
        if($ReturnData){
            $Return[] = $ReturnData;
        }
    }
    return $Return;
}
$NaverKeyWord = NaverKeyWord();
print_r($NaverKeyWord);

 

[/code]

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 20개

감사합니다
7년 전
@dkandkanehd 감사합니다.! 좋은하루되세요!
수고 하셨습니다.
7년 전
감사합니다.!!
아니 실시간 검색어 api가 없다는게 놀랍습니다.
7년 전
api가 있는지 사실 잘 모르겠습니다. ㅋ.ㅋ
7년 전
감사합니다.
혹시 php 버전이라든가 제한이 있나요? 혹시 서버 설정이라도? 전 PHP Version 7.0.16 환경입니다.
감사합니다
이걸 원하는곳에 적용시키는 방법을 알고 싶어요.완전 생초짜입니다 충성

게시글 목록

번호 제목
23254
23244
23241
23236
23200
23199
23179
23174
23138
23128
23125
23116
23109
23099
23092
23083
23079
23063
23050
23036
23029
23007
23003
22983
22959
22943
22939
22934
22905
22897