user1142861
user1142861

Reputation: 1

Extracting title and description from a youtube video url link

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

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

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

Related Questions