<commit_before>var request = require('request');
var cheerio = require('cheerio');

module.exports = function (from, to, url) {
    if (url.length === 1) {
        url = url[0];
    }else{
        url = url[1];
    }
    request(url,{timeout: 1500}, function(error, response, body) {
        if (!error && response.statusCode == 200) {
            $ = cheerio.load(body);
            var title =$('title').text();<commit_msg>fix fetch facebook and ptt(18+) title<commit_after>var request = require('request');
var cheerio = require('cheerio');

module.exports = function (from, to, url) {
    if (url.length === 1) {
        url = url[0];
    }else{
        url = url[1];
    }
    var options = {
        url: url,
        headers: {
            'User-Agent': 'chrome32 on win8 Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36',
            'Cookie': 'over18=1'
        },
        timeout: 1500
    };
    request(options, function(error, response, body) {
        if (!error && response.statusCode == 200) {
            $ = cheerio.load(body);
            var title =$('title').text();
{'fraction_non_alphanumeric': 0.1676802780191138, 'fraction_numerical': 0.04691572545612511, 'mean_word_length': 2.358600583090379, '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': '7343758', 'n_tokens_mistral': 406, 'n_tokens_neox': 368, 'n_words': 92}