0

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 ?

  • read this http://stackoverflow.com/questions/1760231 – Dau Jan 12 '12 at 06:52
  • possible duplicate of [How do I get the title of a youtube video if I have the Video Id?](http://stackoverflow.com/questions/1760231/how-do-i-get-the-title-of-a-youtube-video-if-i-have-the-video-id) – Rafay Jan 12 '12 at 06:53
  • actually i want to do this using jquery – user1142861 Jan 12 '12 at 07:02

1 Answers1

1

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

Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
  • $(document).ready(function() { $.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; alert('hihhhhhhhhhh'); } }); }); this is what i am using but it showing some syntax error – user1142861 Jan 12 '12 at 07:12
  • syntax error http://www.youtube.com/watch?v=YF5i6QXgR8c&feature=g-vrec&context=G24e6571RVAAAAAAAAAQ&alt=json this is the error – user1142861 Jan 12 '12 at 07:21