Reputation: 1
I want to extract the title and a description of a youtube video link using jquery
the url would be like http://www.youtube.com/watch?v=YF5i6QXgR8c&feature=g-vrec&context=G24e6571RVAAAAAAAAAQ
how do i do this ?
Upvotes: 0
Views: 1637
Reputation: 100175
Something like this should work:
$.ajax({
url: "http://www.youtube.com/watch?v=YF5i6QXgR8c&feature=g-vrec&context=G24e6571RVAAAAAAAAAQ&alt=json",
dataType: "jsonp",
success: function (data) {
var title = data.entry.title.$t;
var description = data.entry.media$group.media$description.$t;
}
});
Hope it helps
Upvotes: 1