<commit_before>var fs = require('fs');
var request = require('request');
var $ = require('jquery')(require("jsdom").jsdom().parentWindow);

var url = 'http://plazalasamericas.s3.amazonaws.com/wp-content/uploads/2015/07/BrooksBro-Summer.jpg';
var path = '../Pictures/demo.jpg';

request(url).pipe(fs.createWriteStream(path)).on('close', function () {

});<commit_msg>Scraped plaza images!<commit_after>var fs = require('fs');
var request = require('request');
var $ = require('jquery')(require("jsdom").jsdom().parentWindow);

var url = 'http://www.plazalasamericas.com/promotions-listing/';

request(url, function (error, response, body) {
	if (!error && response.statusCode === 200) {
		$(body).find('#promotions-right').children('table').find('td:nth-child(3)').children('a').each(function () {
			ScrapeSale($(this).attr('href'));
		});
	}

	else {
		console.log(error);
	}
});

function ScrapeSale (url) {
	request(url, function (error, response, body) {
		if (!error && response.statusCode === 200) {
			var imgUrl = $(body).find('#generic-middle').children('img.attachment-full').attr('src');

			var splitUrl = url.split('/');

			DownloadImage(splitUrl[splitUrl.length - 2] ,imgUrl);
		}

		else {
			console.log(error);
		}
	});
}

function DownloadImage(imgName, imgUrl) {
	if (imgUrl) {

		var splitExt = imgUrl.split('.');
		var imgExtension = splitExt[splitExt.length - 1];

		request(imgUrl).pipe(fs.createWriteStream('../Pictures/' + imgName + '.' + imgExtension));
	}
}
{'fraction_non_alphanumeric': 0.21077441077441078, 'fraction_numerical': 0.010774410774410775, 'mean_word_length': 4.967871485943775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6837975', 'n_tokens_mistral': 549, 'n_tokens_neox': 503, 'n_words': 80}