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

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

· 7년 전 · 8540 · 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 환경입니다.
감사합니다
이걸 원하는곳에 적용시키는 방법을 알고 싶어요.완전 생초짜입니다 충성

게시글 목록

번호 제목
24149
24140
24133
24125
24119
24109
24105
24101
24093
24089
24077
24074
24071
24070
24067
24056
24050
24046
24043
24040
24037
24036
24035
24034
24021
24017
24005
24002
23990
23980