2012-08-30 6 views
0

http://www.youtube.com/music에는 Billboard 핫 100 목록이 있습니다. 프로그래밍 방식으로이 목록을 가져 오는 API가 있습니까?Youtube 뮤직 비디오로 상위 100 편의 광고 게시판을 얻을 수있는 무료 단일 API가 있습니까?

최고의 뮤직 비디오를 얻으려면 YouTube API가 있습니다 : http://gdata.youtube.com/feeds/api/standardfeeds/most_popular_Music?v=2&max-results=50&time=this_week하지만 50 개의 동영상 만 제공하며 목록은 빌보드 차트가 아닙니다.

또한 게시판 상위 100, http://www.billboard.com/rss/charts/hot-100에 대한 RSS가 있지만 YouTube 동영상 링크 및 미리보기 이미지는 표시되지 않습니다.

답변

1

페이지 매김을 사용하여 결과를 얻을 수 있습니다.

https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/4sjeUOy9ojE

int count = 1; 
    boolean moreResults = true; 
    while (moreResults) { 
     for (VideoEntry videoEntry : videoFeed.getEntries()) { 
     // Do whatever you'd like with videoEntry... 
     System.out.println(videoEntry.getMediaGroup().getVideoId()); 
     } 
     if (count++ >= 10) { 
     moreResults = false; 
     } else { 
     Link nextLink = videoFeed.getNextLink(); 
     if (nextLink == null) { 
      moreResults = false; 
     } else { 
      videoFeed = service.query(new YouTubeQuery(new 
URL(nextLink.getHref())), VideoFeed.class); 
     } 
     } 
    } 
: 제프리 Posnick에서 그것을 수행하는 방법의 예입니다
관련 문제