<commit_before>var http = require('http');
var url = require('url');
var Scrapper = require('./scrapper.js');

function Server() {

  this.start = function() {
    http.createServer(function(request, response) {
      var urlParams = url.parse(request.url, true);
      if (request.method === 'GET' && urlParams.pathname === '/I/want/title/') {
        var addresses = (urlParams.query.address instanceof String) ? [urlParams.query.address] : urlParams.query.address;
        var titles = [];
        var body = [];

        function scrapTitle(index, callback) {
          new Scrapper(addresses[index], function(result){
            callback(result.url + " - " + result.dom('title').text(), index);
          }, function(error){
            callback(error.url + " - NO RESPONSE", index);
          });
        }
<commit_msg>Fixed: Single address type check<commit_after>var http = require('http');
var url = require('url');
var Scrapper = require('./scrapper.js');

function Server() {

  this.start = function() {
    http.createServer(function(request, response) {
      var urlParams = url.parse(request.url, true);
      if (request.method === 'GET' && urlParams.pathname === '/I/want/title/') {
        var addresses = (typeof(urlParams.query.address) == 'string') ? [urlParams.query.address] : urlParams.query.address;
        var titles = [];
        var body = [];

        function scrapTitle(index, callback) {
          new Scrapper(addresses[index], function(result){
            callback(result.url + " - " + result.dom('title').text(), index);
          }, function(error){
            callback(error.url + " - NO RESPONSE", index);
          });
        }

{'fraction_non_alphanumeric': 0.16557083084279736, 'fraction_numerical': 0.0, 'mean_word_length': 2.761797752808989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7442511', 'n_tokens_mistral': 476, 'n_tokens_neox': 471, 'n_words': 101}