@@ -0,0 +1,1705 @@
+const config = require('../../data/config.json').github;%0Aconst request = require('request').defaults(%7B%0A    method: 'PATCH',%0A    headers: %7B%0A      Accept: '*/*',%0A      Connection: 'close',%0A      'User-Agent': 'instaupdate'%0A    %7D,%0A    'auth': %7B%0A      'user': config.username,%0A      'pass': config.personalAccessToken%0A    %7D%0A%7D);%0A%0Aconst baseUrl = 'https://api.github.com/';%0A%0Aexports.change = function (data, globalCb) %7B%0A  let reach = data.image ? 2 : 1;%0A  let count = 0;%0A%0A  const callback = function(err) %7B%0A    if(err) %7B%0A      count = 3;%0A      return globalCb(err);%0A    %7D%0A%0A    if(++count === reach && globalCb) %7B%0A      globalCb();%0A    %7D%0A  %7D;%0A%0A  request(baseUrl + 'user', %7B%0A    name: data.name,%0A    blog: data.url,%0A    location: data.location,%0A    bio: data.description%0A  %7D, function (err, res, body) %7B%0A    handleResponse(callback, err, res, body);%0A  %7D);%0A%0A%7D;%0A%0A  //Github currently does not seem to support profile image updating%0A  /*if(!data.image) %7B%0A    return;%0A  %7D%0A%0A  request(baseUrl + '', %7B%0A    image: data.image%0A  %7D, function (err, res, body) %7B%0A    handleResponse(callback, err, res, body);%0A  %7D);%0A%7D;*/%0A%0Afunction handleResponse(callback, err, res, body) %7B%0A    if (err) %7B%0A        return callback(err);%0A    %7D%0A%0A    // Check status code%0A    if (res.statusCode %3C 200 %7C%7C res.statusCode %3E 299) %7B%0A        return callback(new Error('Invalid response code: ' + res.statusCode));%0A    %7D%0A%0A    try %7B%0A        // Empty string is a valid response%0A        if (body === '') %7B%0A            return callback();%0A        %7D%0A%0A        body = JSON.parse(body);%0A    %7D catch (e) %7B%0A        return callback(e);%0A    %7D%0A%0A    // Check twitter response%0A    let errs = body%5B'errors'%5D;%0A%0A    if (errs !== undefined) %7B%0A        callback(errs);%0A    %7D%0A%7D%0A

Add Github service file