<commit_before>var http = require('http');
var https = require("https");
var url = require('url');
var qs = require('querystring');

var server = http.createServer(function(req, res) {

	if (req.url === "/favicon.ico") {
		res.writeHead(404, {});
		res.end('not found');
	}

	var u = url.parse(req.url);
	if (u.pathname === "/search") {
		var query = qs.parse(u.query);
		if (!query.q) {
			res.end("usage: /search?q=...");
			return;
		}
		var options = {
			hostname: "www.google.com",
			port: 443,
			path: req.url,
			headers: {
				"Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.6,en-US;q=0.4,en;q=0.2",
				"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36",
				"Cookie": "PREF=ID=047808f19f6de346:U=0f62f33dd8549d11:FF=2:LD=zh-CN:NW=1:TM=1325338577:LM=1332142444:GM=1:SG=2:S=rE0SyJh2w1IQ-Maw"
			}
		};

		var request = https.request(options, function(response) {
			var data = "";
			response.on("data", function(d) {
				data += d;
			});
			response.on("end", function(d) {
				data += d;
				res.end(data);<commit_msg>delete all script tag<commit_after>var http = require('http');
var https = require("https");
var url = require('url');
var qs = require('querystring');

var server = http.createServer(function(req, res) {

	if (req.url === "/favicon.ico") {
		res.writeHead(404, {});
		res.end('not found');
	}

	var u = url.parse(req.url);
	if (u.pathname === "/search") {
		var query = qs.parse(u.query);
		if (!query.q) {
			res.end("usage: /search?q=...");
			return;
		}
		var options = {
			hostname: "www.google.com",
			port: 443,
			path: req.url,
			headers: {
				"Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.6,en-US;q=0.4,en;q=0.2",
				"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36",
				"Cookie": "PREF=ID=047808f19f6de346:U=0f62f33dd8549d11:FF=2:LD=zh-CN:NW=1:TM=1325338577:LM=1332142444:GM=1:SG=2:S=rE0SyJh2w1IQ-Maw"
			}
		};

		var request = https.request(options, function(response) {
			var data = "";
			response.on("data", function(d) {
				data += d;
			});
			response.on("end", function(d) {
				data += d;
				res.end(data.replace(/<script>.+?<\/script>/mg,""));
{'fraction_non_alphanumeric': 0.21694764862466726, 'fraction_numerical': 0.07985803016858918, 'mean_word_length': 3.7373949579831933, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '39012', 'n_tokens_mistral': 1160, 'n_tokens_neox': 963, 'n_words': 154}