google-plus-api.js
function makeRequest(apiKey, path, opts, callback) {
    var 
        key,
        req,
        dataStr = '';
        
    if(callback === undefined) {
        throw 'No callback defined';
        return;
    }

    path = '/plus/v1/' + path + '?key=' + apiKey;
    for(key in opts) {
        path += '&' + key + '=' + opts[key];
    }

    req = https.request({
        host: 'www.googleapis.com',
        port: 443,
        path: path,
        method: 'GET'
    }, function(res) {
        res.on('data', function(data) {
            dataStr += data;
        });
        
        res.on('end', function() {
            if(opts.alt === undefined || opts.alt.toLowerCase() == 'json') {
                try {
                    callback(null, JSON.parse(dataStr));
                } catch(err) {
                    callback(null, dataStr);
                }
            }
            else {
                callback(null, dataStr);
            }
        });
        
        res.on('close', function () {
            res.emit('end');
        });
    });
    req.end();
    
    req.on('error', function(err) {
        callback(err);
    });

    return req;
}
function makeRequest(apiKey, path, opts, callback) {
    var 
        key,
        req,
        dataStr = '';
        
    if(callback === undefined) {
        throw 'No callback defined';
        return;
    }

    path = '/plus/v1/' + path + '?key=' + apiKey;
    for(key in opts) {
        path += '&' + key + '=' + opts[key];
    }

    req = https.request({
        host: 'www.googleapis.com',
        port: 443,
        path: path,
        method: 'GET'
    }, function(res) {
        res.on('data', function(data) {
            dataStr += data;
        });
        
        res.on('end', function() {
            if(opts.alt === undefined || opts.alt.toLowerCase() == 'json') {
                try {
                    callback(null, JSON.parse(dataStr));
                } catch(err) {
                    callback(null, dataStr);
                }
            }
            else {
                callback(null, dataStr);
            }
        });
        
        res.on('close', function () {
            res.emit('end');
        });
    });
    req.end();
    
    req.on('error', function(err) {
        callback(err);
    });

    return req;
}
function makeRequest ( apiKey , path , opts , callback ) { var key , req , dataStr = '' ; if ( callback === undefined ) { throw 'No callback defined' ; return ; } path = '/plus/v1/' + path + '?key=' + apiKey ; for ( key in opts ) { path += '&' + key + '=' + opts [ key ] ; } req = https . request ( { host : 'www.googleapis.com' , port : 443 , path : path , method : 'GET' } , function ( res ) { res . on ( 'data' , function ( data ) { dataStr += data ; } ) ; res . on ( 'end' , function ( ) { if ( opts . alt === undefined || opts . alt . toLowerCase ( ) == 'json' ) { try { callback ( null , JSON . parse ( dataStr ) ) ; } catch ( err ) { callback ( null , dataStr ) ; } } else { callback ( null , dataStr ) ; } } ) ; res . on ( 'close' , function ( ) { res . emit ( 'end' ) ; } ) ; } ) ; req . end ( ) ; req . on ( 'error' , function ( err ) { callback ( err ) ; } ) ; return req ; }
Private function, used to make requests to G+

Takes the path, any options (becomes query params) & a callback

Returns the HTTP request instance
Private function used to make requests to G +