<commit_before>var express = require('express');
var router = express.Router();
var bodyParser = require('body-parser');
var unirest = require('unirest');
var pretty_json = require('prettyjson');

router.get('/', function(req, res) {
  var promise = new Promise(
    function (resolve, reject) {
      var data = get_number_of_issues("ggchan0");
      setTimeout(function() {
        resolve(data);
      }, 5000);
    }
  );
  promise.then(function(data){
    var obj = {"total_issues" : data};
    console.log(obj);
    res.json(obj);
  })
  .catch(function(reason){
    console.log("ERROR");
    console.log(reason);
  });
});

router.get('/number_of_issues', function(req, res) {
  unirest.get("https://api.github.com/search/issues?q=author:" + "ggchan0")
  .headers({'User-Agent' : 'ggchan0', 'Content-Type' : 'application/json'})
  .end(function(response) {
    var total = JSON.parse(response.raw_body).total_count;
    var obj = {"total_issues" : total};
    res.json(obj);
  });
});

router.get('/number_of_followers', function(req, res){
  unirest.get("https://api.github.com/users/" + "ggchan0" + "/followers")
  .headers({'User-Agent' : 'ggchan0', 'Content-Type' : 'application/json'})
  .end(function(response) {
    var total = JSON.parse(response.raw_body).length;
    console.log(total);
    var obj = {"total_followers" : total};
    res.json(obj);
  });
});

function get_commits_by_user(user) {

}

module.exports = router;<commit_msg>added a route for a user<commit_after>var express = require('express');
var router = express.Router();
var bodyParser = require('body-parser');
var unirest = require('unirest');
var pretty_json = require('prettyjson');

router.get('/', function(req, res) {
  var promise = new Promise(
    function (resolve, reject) {
      var data = get_number_of_issues("ggchan0");
      setTimeout(function() {
        resolve(data);
      }, 5000);
    }
  );
  promise.then(function(data){
    var obj = {"total_issues" : data};
    console.log(obj);
    res.json(obj);
  })
  .catch(function(reason){
    console.log("ERROR");
    console.log(reason);
  });
});

router.get('/number_of_issues', function(req, res) {
  unirest.get("https://api.github.com/search/issues?q=author:" + "ggchan0")
  .headers({'User-Agent' : 'ggchan0', 'Content-Type' : 'application/json'})
  .end(function(response) {
    var total = JSON.parse(response.raw_body).total_count;
    var obj = {"total_issues" : total};
    res.json(obj);
  });
});

router.get('/number_of_followers', function(req, res){
  unirest.get("https://api.github.com/users/" + "ggchan0" + "/followers")
  .headers({'User-Agent' : 'ggchan0', 'Content-Type' : 'application/json'})
  .end(function(response) {
    var total = JSON.parse(response.raw_body).length;
    console.log(total);
    var obj = {"total_followers" : total};
    res.json(obj);
  });
});

function get_commits_by_user(user) {

}

router.get('/users/:username', function(req, res){
  unirest.get("https://api.github.com/users/" + req.params.username)
  .headers({'User-Agent' : 'ggchan0', 'Content-Type' : 'application/json'})
  .end(function(response) {
    res.json(response.body);
  });
});

module.exports = router;
{'fraction_non_alphanumeric': 0.19289978008168396, 'fraction_numerical': 0.0059692114357524344, 'mean_word_length': 4.045958795562599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4854798', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1097, 'n_words': 181}