JSON – Building a custom YouTube app

I was playing with JSON on youtube the other day and built a web app that just pulls down videos and presents them however you like. The idea was to show a class that JSON is not to scary and that making a app is not to hard if you have jQuery mobile or a boilerplate kicking around. The app can be seen running here (dubbed youTube awsome-er app), though be warned, it had no love put into it and was for teaching purposes.

It did get me thinking that this would make a great platform for teaching. Armed with a smart phone with youTube capture you could quickly make content and students could very quickly see that content. Might be good for capturing FAQ in papers.

The basic JSON request looks like:

function showSkrillexVideos(data) {
  var feed = data.feed;
  var entries = feed.entry;
  var html = '
    '; for (var i = 0; i < entries.length; i++) { var entry = entries[i]; var title = entry.title.$t.substr(0, 60); var thumbnailUrl = entries[i].media$group.media$thumbnail[0].url; var playerUrl = entries[i].media$group.media$content[0].url; html += 'html goes here' + title + 'html goes here' + playerUrl + 'html goes here' + thumbnailUrl + 'html goes here'; } html += '
'; document.getElementById('videos').innerHTML = html; }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s