Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
156 lines (153 sloc) 3.81 KB
<!DOCTYPE html>
<html>
<head>
<title> jQuery Youtube </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<style type="text/css">
.videos {
list-style: none;
margin: 0;
padding: 0;
overflow: hidden;
}
.videos li {
float: left;
border: 1px solid #B6B6B6;
width: 150px;
height: 140px;
margin: 0 10px 10px 0;
padding: 5px;
}
.videos li img {
width: 120px;
height: 90px;
}
ul.videos.large li {
width: 240px;
height: 260px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="jquery.jTube.js" charset="utf-8"></script>
<script type="text/javascript">
$(function() {
$.jTube({
user: "twofivethreetwo",
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
$('#myVideos').append('<li><a href="'+this.link+'"><img src="'+this.thumbnail+'"><br>'+this.title+'</a> - '+this.length+'</li>');
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
search: "splinter cell",
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
$('#myVideos2').append('<li><a href="'+this.link+'"><img src="'+this.thumbnail+'"><br>'+this.title+'</a> - '+this.length+'</li>');
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
feed: 'top_rated',
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
$('#myVideos3').append('<li><a href="'+this.link+'"><img src="'+this.thumbnail+'"><br>'+this.title+'</a> - '+this.length+'</li>');
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
playlist: 'D92C6F7092127B48',
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
html = '<li>';
html += '<a href="'+this.link+'">'+this.title+'</a> - '+this.length+'';
html += $.jTubeEmbed(this.video, {width: 240, height: 200});
html += '</li>';
$('#myVideos4').append(html);
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
user: "defvayne23",
userType: 'playlists',
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
$('#myVideos5').append('<li class="small"><a href="'+this.link+'">'+this.title+'</a></li>');
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
user: "twofivethreetwo",
userType: 'subscriptions',
limit: 10,
page: 1,
success: function(videos) {
$(videos).each(function() {
$('#myVideos6').append('<li class="small"><a href="'+this.link+'"><img src="'+this.thumbnail+'"><br>'+this.title+'</a></li>');
});
},
error: function(error) {
alert(error);
}
});
$.jTube({
user: "adultswim",
userType: 'contacts',
limit: 10,
page: 1,
success: function(contacts) {
$(contacts).each(function() {
if(this.status == 'accepted') {
$('#myVideos7').append('<li class="small"><a href="'+this.link+'">'+this.username+'</a></li>');
}
});
},
error: function(error) {
$('#myVideos7').html(error);
}
});
});
</script>
</head>
<body>
<h2>Videos by 'twofivethreetwo':</h2>
<ul id="myVideos" class="videos"></ul>
<h2>Search videos for 'splinter cell':</h2>
<ul id="myVideos2" class="videos"></ul>
<h2>Video feed for 'top rated':</h2>
<ul id="myVideos3" class="videos"></ul>
<h2>Video feed for my playlist 'Music' (D92C6F7092127B48):</h2>
<ul id="myVideos4" class="videos large"></ul>
<h2>Video playlists for `defvayne23`:</h2>
<ul id="myVideos5" class="videos"></ul>
<h2>Video subscriptions for `twofivethreetwo`:</h2>
<ul id="myVideos6" class="videos"></ul>
<h2>Contacts for `adultswim`:</h2>
<ul id="myVideos7" class="videos"></ul>
</body>
</html>