Skip to content

Instantly share code, notes, and snippets.

@pasindud
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save pasindud/0f9b8a815808b030328c to your computer and use it in GitHub Desktop.

Select an option

Save pasindud/0f9b8a815808b030328c to your computer and use it in GitHub Desktop.
termish youtube search
'use strict';
jQuery.get("https://gdata.youtube.com/feeds/api/videos?vq=pasindudesilva&alt=json",function(d){
stdout(null, d);
return true;
});
/*var request = new XMLHttpRequest();
request.open('GET', 'http://gdata.youtube.com/feeds/api/videos?vq='+args[0]+'&alt=json', true);
request.onreadystatechange = function()
{
if (request.readyState != 4)
return false;
var status = request.status;
//maybe not successful?
if (status != 200) {
stdout(status);
}
stdout(null, JSON.parse(request.responseText));
return true;
}
request.send();*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment