Skip to content

Instantly share code, notes, and snippets.

Created September 21, 2011 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1233073 to your computer and use it in GitHub Desktop.
Save anonymous/1233073 to your computer and use it in GitHub Desktop.
Youtube
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
//inicio o jquery
$(document).ready(function(){
$.ajax({
url: "http://gdata.youtube.com/feeds/base/users/videosimprovaveis/uploads?orderby=updated&v=2&alt=json",
dataType: "jsonp",
success: function(data){
console.log('SUCESSO');
console.log(data);
var html = '';
var i = 0;
while(i < data.results.length)
{
var titulo = data.results[i].title;
var user = data.results[i].author;
html ="<p>"+titulo+"</p>";
html +="<p>"+user+"</p>";
i++;
}
$('#youtube').html(html);
},
error : function(a , b){
console.log('ERRO');
console.log(a, b);
}
});
});
</script>
<div id="youtube">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment