19
What is the easiest way to get the title from the youtybe video , for example this video title :
http://www.youtube.com/watch?v=Wp7B81Kx66o
Thanks !
What is the easiest way to get the title from the youtybe video , for example this video title :
http://www.youtube.com/watch?v=Wp7B81Kx66o
Thanks !
Try this:
<script type="text/javascript">
function showMyVideos(data) {
var feed = data.feed;
var entries = feed.entry || [];
var html = ['<ul>'];
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
var title = entry.title.$t;
html.push('<li>', title, '</li>');
}
html.push('</ul>');
document.getElementById('videos').innerHTML = html.join('');
}
</script>
and this in your body part:
<body>
<div id="videos">
<script
type="text/javascript"
src="http://gdata.youtube.com/feeds/users/GoogleDevelopers/uploads?alt=json-in-script&format=5&callback=showMyVideos">
</script>
</div>
</body>