<commit_before>var request = require('request');
var validator = require('validator');
var validProtocols = {
  'http': 'true',
  'https': 'true'
}

var obj = {
  get: function(url, cb){
  var protocolIdentifier = url.split('://');
  if(validProtocols[protocolIdentifier[0]]){
    request(url, function (error, response, html) {
      cb(error, response, html);
    })
  } else {
      cb('invalid url', null, null);
    }
  }
};

module.exports = obj;


// obj.get(url, function(error, response, html){
//     if (!error && response.statusCode == 200) {
//       console.log('success');
//       // console.log(html);        
//     } else {
//       console.log('failure')
//       console.log('error -' + error);
//     }
//   }
// );<commit_msg>[feature] added basic scraper with passing tests<commit_after>var request = require('request');
var validator = require('validator');
var validProtocols = {
  'http': 'true',
  'https': 'true'
}

var obj = {
  get: function(url, cb){
  var protocolIdentifier = url.split('://');
  if(validProtocols[protocolIdentifier[0]]){
    request(url, function (error, response, html) {
      cb(error, response, html);
    })
  } else {
      cb('invalid url', null, null);
    }
  }
};

module.exports = obj;

{'fraction_non_alphanumeric': 0.188951160928743, 'fraction_numerical': 0.0040032025620496394, 'mean_word_length': 3.032258064516129, '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': '3390859', 'n_tokens_mistral': 408, 'n_tokens_neox': 404, 'n_words': 92}