0

http://www.youtube.com/musicには、ビルボードのホット 100 リストがあります。このリストをプログラムで取得する API はありますか?

トップ ミュージック ビデオを取得するための youtube API があることは知っています: http://gdata.youtube.com/feeds/api/standardfeeds/most_popular_Music?v=2&max-results=50&time=this_weekですが、50 個のビデオとリストのみが返されます。ビルボードチャートではありません。

また、Billboard トップ 100 の RSS ( http://www.billboard.com/rss/charts/hot-100 ) もありますが、Youtube ビデオ リンクとサムネイル画像は返されません。

4

1 に答える 1

1

ページネーションを使用して結果を取得できます。Jeffrey Posnick による方法の例があります。

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); 
        } 
      } 
    } 
于 2012-12-01T17:42:30.803 に答える