examples/findserverbyname.js
function findname(error, response, body) {
		if (error){
                        return error
                }
              	if (body){
			try{
				var info = JSON.parse(body)
			}
			catch(err){
				console.log(body)
				return
			}			
			if (info.items){
		        	var ilen=info.items.length
		        	while(ilen--){
		                	var it=info.items[ilen]
		                	var thename=it['properties']['name']
		                	if (thename.match(srchfor)){
		         			console.log(it) // <---- print json for server(s) that match srchfor
		                	}
                                }
                        }
                }
}
function findname(error, response, body) {
		if (error){
                        return error
                }
              	if (body){
			try{
				var info = JSON.parse(body)
			}
			catch(err){
				console.log(body)
				return
			}			
			if (info.items){
		        	var ilen=info.items.length
		        	while(ilen--){
		                	var it=info.items[ilen]
		                	var thename=it['properties']['name']
		                	if (thename.match(srchfor)){
		         			console.log(it) // <---- print json for server(s) that match srchfor
		                	}
                                }
                        }
                }
}
function findname ( error , response , body ) { if ( error ) { return error } if ( body ) { try { var info = JSON . parse ( body ) } catch ( err ) { console . log ( body ) return } if ( info . items ) { var ilen = info . items . length while ( ilen -- ) { var it = info . items [ ilen ] var thename = it [ 'properties' ] [ 'name' ] if ( thename . match ( srchfor ) ) { console . log ( it ) // <---- print json for server(s) that match srchfor } } } } }
findname will be our callback
findname will be our callback