<commit_before>var htmlparser = require("htmlparser2");
var request = require("request");

/* GET users listing. */
var ogapi = function(){
	return this;
};

/**
*	Test if a url is well formated
*/
ogapi.testUrl = function(url){
	return /^(http(s)?:\/\/[a-zA-Z0-9\-_]+\.[a-zA-Z]+(.)+)+/.test(url);
};

ogapi.graph = function(url){
	var self = this;
	return self.openUrl(url, function(dom){
		return self.parseDom(dom, function(content){
			return content;
		});
	})
};

ogapi.graphDom = function(dom){
	var self = this;
	self.parseDom(dom, this.ongraph);
};

ogapi.ongraph = function(json){
	console.log('ongraph', json);
};
<commit_msg>add test for parsing<commit_after>var htmlparser = require("htmlparser2");
var request = require("request");

/* GET users listing. */
var ogapi = function(){
	return this;
};

/**
*	Test if a url is well formated
*/
ogapi.testUrl = function(url){
	return /^(http(s)?:\/\/[a-zA-Z0-9\-_]+\.[a-zA-Z]+(.)+)+/.test(url);
};

ogapi.graph = function(url fn){
	var self = this;
	return self.openUrl(url, function(dom){
		return self.parseDom(dom, fn);
	})
};

{'fraction_non_alphanumeric': 0.2130394857667585, 'fraction_numerical': 0.005509641873278237, 'mean_word_length': 4.117370892018779, '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': '5137899', 'n_tokens_mistral': 425, 'n_tokens_neox': 408, 'n_words': 89}