Reputation: 2888
On http://www.youtube.com/music, there's a Billboard hot 100 list. Is there a API to get this list programmatically?
I know there's a youtube API to get the top music videos: http://gdata.youtube.com/feeds/api/standardfeeds/most_popular_Music?v=2&max-results=50&time=this_week, however it only returns 50 videos and the list is not the Billboard chart.
And there's also a rss for Billboard top 100, http://www.billboard.com/rss/charts/hot-100, but it doesn't return Youtube video links and thumbnail images.
Upvotes: 0
Views: 3097
Reputation: 2296
You can get the result using pagination. There is an example from Jeffrey Posnick of how to do it:
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);
}
}
}
Upvotes: 1