Created
November 21, 2010 20:06
-
-
Save pope/709091 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processListOfVideos(obj) { | |
// My assumption is that $('#listOfVideos') resolves to an unordered list so that I can put things into it | |
var ul = $('#listOfVideos'); | |
$.each(obj.entry, function() { | |
var mediaUrl = this['media$group']['media$player'][0].url; | |
$('<li/>', { html: mediaUrl }).appendTo(ul); | |
}); | |
// If there are any more videos, load them too | |
$.each(obj.link, function() { | |
if (this.rel === 'next') { | |
$.getJSON(this.rel + '&callback=?', processListOfVideos); | |
} | |
}); | |
} | |
$.getJSON("http://gdata.youtube.com/feeds/api/users/Deckswax/uploads?alt=json&callback=?", processListOfVideos); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment