<commit_before>const request = require('request');
const parse   = require('xml2js').parseString;
const moment  = require('moment-timezone');

const DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
const WS_URL = 'http://webservices.rm.ingv.it/fdsnws/event/1/query';

class Ingv {
	constructor(options = {}) {
		if (!options.startDate) {
			options.startDate = moment.utc().subtract(1, 'd');
		}
		
		if (!options.endDate) {
			options.endDate = moment.utc().add(1, 'd');
		}
		
		this.startDate = options.startDate;
		this.endDate = options.endDate;
		
		this.minMagnitude = options.minMagnitude || 2;
		this.maxMagnitude = options.maxMagnitude || 10;
		
		this.minLatitude = options.minLatitude || 35;
		this.maxLatitude = options.maxLatitude || 49;
		this.minLongitude = options.minLongitude || 5;
		this.maxLongitude = options.maxLongitude || 20;
		
		this.timeout = options.timeout || 35000;
	}
	
	get(callback) {
		let params = {
			starttime: this.startDate.format(DATETIME_FORMAT),
			endtime: this.endDate.format(DATETIME_FORMAT),<commit_msg>request only last 6 hours of earthquakes. close #6<commit_after>const request = require('request');
const parse   = require('xml2js').parseString;
const moment  = require('moment-timezone');

const DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
const WS_URL = 'http://webservices.rm.ingv.it/fdsnws/event/1/query';

class Ingv {
	constructor(options = {}) {
		if (!options.startDate) {
			// Get the earthquakes for the last 6 hours
			// Previously 24 hours, but useless
			// see https://github.com/botfactoryit/terremotibot/issues/6
			options.startDate = moment.utc().subtract(6, 'hours');
		}
		
		if (!options.endDate) {
			// Choose a endDate in the future for the query, in order
			// to be sure to get all the earthquakes
			options.endDate = moment.utc().add(6, 'hours');
		}
		
		this.startDate = options.startDate;
		this.endDate = options.endDate;
		
		this.minMagnitude = options.minMagnitude || 2;
		this.maxMagnitude = options.maxMagnitude || 10;
		
		this.minLatitude = options.minLatitude || 35;
		this.maxLatitude = options.maxLatitude || 49;
		this.minLongitude = options.minLongitude || 5;
		this.maxLongitude = options.maxLongitude || 20;
		
		this.timeout = options.timeout || 35000;
	}
	
	get(callback) {
		let params = {
			starttime: this.startDate.format(DATETIME_FORMAT),
			endtime: this.endDate.format(DATETIME_FORMAT),
{'fraction_non_alphanumeric': 0.1399832355406538, 'fraction_numerical': 0.018440905280804692, 'mean_word_length': 3.9216494845360823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '300147', 'n_tokens_mistral': 935, 'n_tokens_neox': 798, 'n_words': 161}