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

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

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

게시글 목록

번호 제목
23798
23797
23792
23791
23785
23781
23770
23766
23764
23761
23747
23732
23724
23718
23706
23700
23697
23686
23682
23681
23680
23678
23665
23644
23643
23639
23637
23630
23626
23616