<commit_before>'use strict';

const AmazonProducts = require('crawl-amazon-products');
const fs = require('fs');

const productUrls= require('./startUrls');

const outFileName= 'index.html';

const limit= undefined;

// fetch products (https://www.npmjs.com/package/crawl-amazon-products)
const getProducts= url => new Promise((resolve, reject) => { AmazonProducts.getProducts({ url, limit }, (err, products) => err ? reject(err) : resolve(products)); });

// write products to index.html
const outProds= allProds => {
    let body= '';
    for ( let asin in allProds ) {
        let prod= allProds[asin];
        body+= '<div class="prod"><a href="' + prod.url + '" taget="_new"><img src="' + prod.image + '">' + prod.title + '</a></div>';
    }

    const html= '<html><head><meta charset="UTF-8"><stlye>'
        + '.prod { widht: 24%; float: left; padding: .5% }'
        + 'img { height: 100px; vertical-align: middle; float: left;}'
        + '</style></head><body>'
        + body
        + '</body></html>'
    ;

    return new Promise((resolve, reject) => {
        fs.writeFile(outFileName, html, err => err ? reject(err) : resolve(allProds));
    });
};

const fetchFns= productUrls.map(
    url =>
        allProds =>
            getProducts(url)
                .then(prods => {
                    prods
                        .filter(prod => prod.price.match(/EUR 0,00$/))<commit_msg>fixed Typo<commit_after>'use strict';

const AmazonProducts = require('crawl-amazon-products');
const fs = require('fs');

const productUrls= require('./startUrls');

const outFileName= 'index.html';

const limit= undefined;

// fetch products (https://www.npmjs.com/package/crawl-amazon-products)
const getProducts= url => new Promise((resolve, reject) => { AmazonProducts.getProducts({ url, limit }, (err, products) => err ? reject(err) : resolve(products)); });

// write products to index.html
const outProds= allProds => {
    let body= '';
    for ( let asin in allProds ) {
        let prod= allProds[asin];
        body+= '<div class="prod"><a href="' + prod.url + '" target="_new"><img src="' + prod.image + '">' + prod.title + '</a></div>';
    }

    const html= '<html><head><meta charset="UTF-8"><stlye>'
        + '.prod { widht: 24%; float: left; padding: .5% }'
        + 'img { height: 100px; vertical-align: middle; float: left;}'
        + '</style></head><body>'
        + body
        + '</body></html>'
    ;

    return new Promise((resolve, reject) => {
        fs.writeFile(outFileName, html, err => err ? reject(err) : resolve(allProds));
    });
};

const fetchFns= productUrls.map(
    url =>
        allProds =>
            getProducts(url)
                .then(prods => {
                    prods
                        .filter(prod => prod.price.match(/EUR 0,00$/))
{'fraction_non_alphanumeric': 0.185, 'fraction_numerical': 0.007142857142857143, 'mean_word_length': 2.7247340425531914, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 51, 'https://': 2, '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': '28372', 'n_tokens_mistral': 908, 'n_tokens_neox': 857, 'n_words': 206}