Improved autonomies names, cron job return

This commit is contained in:
vjrj 2018-03-22 09:38:40 +01:00
parent de7c56d99b
commit 9ee01a6ef8
3 changed files with 13 additions and 10 deletions

View file

@ -34,6 +34,7 @@ const countFires = (regions, stringsToRemove) => {
regions.features.forEach((region) => { regions.features.forEach((region) => {
const regionName = cleanProv(region.properties.name, stringsToRemove); const regionName = cleanProv(region.properties.name, stringsToRemove);
if (debug) console.log(`${regionName} -----`);
try { try {
const fires = findFiresInRegion(region); const fires = findFiresInRegion(region);
// TODO Also check neighbour fires (when better implementation of that part) // TODO Also check neighbour fires (when better implementation of that part)

View file

@ -16,11 +16,12 @@ const stringsToRemove = [
['Región de', ''], ['Región de', ''],
['Valencia', 'CValenciana'], ['Valencia', 'CValenciana'],
['Comunidad de Madrid', 'CMadrid'], ['Comunidad de Madrid', 'CMadrid'],
['La Mancha', 'CLMancha'], ['León', 'CyLeón'],
['León', 'CyL'], ['Leon', 'CyLeón'],
['Castilla-', ''], ['Castilla-', ''],
['Cataluña/', ''], ['Cataluña/', ''],
['Cataluña', 'Catalunya'], ['Cataluña', 'Catalunya'],
['La Mancha', 'CLMancha'],
['Baleares', 'IllesBalears'], ['Baleares', 'IllesBalears'],
['Galicia', 'Galiza'], ['Galicia', 'Galiza'],
['Principado de', ''], ['Principado de', ''],
@ -65,7 +66,9 @@ const tweetFires = () => {
} else { } else {
tweet(tweetText, 'es'); tweet(tweetText, 'es');
} }
return tweetText;
} }
return '';
}; };
if (Meteor.isDevelopment) { if (Meteor.isDevelopment) {

View file

@ -55,14 +55,13 @@ Meteor.startup(() => {
} }
return sched; return sched;
}, },
job: () => { job: () => tweetFires()
tweetFires(); /* console.log('cron is working');
// console.log('cron is working'); * console.log(this.userID) // Context Object becomes this argument
/* console.log(this.userID) // Context Object becomes this argument
* console.log(this.magic) / * console.log(this.magic) /
* var numbersCrunched = CrushSomeNumbers(); * var numbersCrunched = CrushSomeNumbers();
* return numbersCrunched; */ * return numbersCrunched;
} return tweetFires(); */
}); });
SyncedCron.start(); SyncedCron.start();