function doYtSearch(pageToken) {
    $('#search-results').empty();
    gapi.client.youtube.search.list({
	'part' : 'snippet',
	'q'    : $('#search-string').val(),
	'type' : 'video',
	'pageToken' : pageToken
    }).then(function(resp) {
	console.log(resp.result);
	updatePrevButton(resp.result.prevPageToken);
	updateNextButton(resp.result.nextPageToken);
	updateResults(resp.result.items);
    }, function(reason) {
	console.log('Error: ' + reason.result.error.message);
    });	
}
/**
 * Execute the search on youtube using Google's api
 *
 * @param pageToken token string for previous/next page
 * @return void
 *
 * @todo This needs to fetch data from the database when it exists
 */
Execute the search on youtube using Google's api
@param pageToken token string for previous/next page
@return void

@todo This needs to fetch data from the database when it exists
Execute the search on youtube using Google ' s api @param pageToken token string for previous / next page @return void @todo This needs to fetch data from the database when it exists
function doYtSearch(pageToken) {
    $('#search-results').empty();
    gapi.client.youtube.search.list({
	'part' : 'snippet',
	'q'    : $('#search-string').val(),
	'type' : 'video',
	'pageToken' : pageToken
    }).then(function(resp) {
	console.log(resp.result);
	updatePrevButton(resp.result.prevPageToken);
	updateNextButton(resp.result.nextPageToken);
	updateResults(resp.result.items);
    }, function(reason) {
	console.log('Error: ' + reason.result.error.message);
    });	
}
function doYtSearch ( pageToken ) { $ ( '#search-results' ) . empty ( ) ; gapi . client . youtube . search . list ( { 'part' : 'snippet' , 'q' : $ ( '#search-string' ) . val ( ) , 'type' : 'video' , 'pageToken' : pageToken } ) . then ( function ( resp ) { console . log ( resp . result ) ; updatePrevButton ( resp . result . prevPageToken ) ; updateNextButton ( resp . result . nextPageToken ) ; updateResults ( resp . result . items ) ; } , function ( reason ) { console . log ( 'Error: ' + reason . result . error . message ) ; } ) ; }
Execute the search on youtube using Google's api
 @param pageToken token string for previous/next page
 @return void
Execute the search on youtube using Google ' s api @param pageToken token string for previous / next page @return void