Posted By

nikefido on 05/25/11


Tagged

jqueryyoutube


Versions (?)

Youtube public channel uploaded videos


 / Published in: jQuery
 

More complete docs here: http://code.google.com/apis/youtube/2.0/developersguideprotocolapiquery_parameters.html#orderbysp Note the use of alt=json. jQuery will append &callback=FUNCTIONNAME automatically. Example url: http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2&callback=func&alt=json

  1. //See more http://code.google.com/apis/youtube/2.0/developers_guide_protocol_api_query_parameters.html
  2. $.ajax({
  3. type:'GET',
  4. dataType:'jsonp',
  5. //url:'http://gdata.youtube.com/feeds/users/USERNAME/uploads?alt=json', //also usable, but less awesome
  6. url:'http://gdata.youtube.com/feeds/api/videos',
  7. data:{author:'USERNAME', v:2, orderby:'published', alt:'json', 'max-results':10},
  8. success:function(data, textStatus, XMLHttpRequest) {
  9. console.log(data);
  10. },
  11. error:function(eq, status, error) {
  12. alert('error: '+status);
  13. }
  14. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: soulm9 on June 4, 2011

Nice.

You need to login to post a comment.