diff options
-rw-r--r-- | Functions/dateFuncs.js | 6 | ||||
-rw-r--r-- | food.js | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Functions/dateFuncs.js b/Functions/dateFuncs.js index caec1c9..feda2d9 100644 --- a/Functions/dateFuncs.js +++ b/Functions/dateFuncs.js @@ -46,9 +46,9 @@ function run_at_monday_mornings(func) { days_to_elapse = 8 - weekday; ms_to_elapse = ms_in_h * ( days_to_elapse * 24/*hours in a day*/ - - hour + 1.5 // removes unneccessary hours so that we update it at 1:30 am - // 1:30 just in case the foods aren't updated instantly to the city's - // servers. + - hour + 1.5 // removes unneccessary hours so that we update it at 1:30 am just + //in case the foods aren't updated instantly to the city's + // servers. ); setTimeout(() => run_at_monday_mornings(func), ms_to_elapse); @@ -3,8 +3,8 @@ const open = require("./Functions/open.js"); const { weekdayToNumber } = require("./Functions/dateFuncs.js"); function* scrapeFood(data) -{ - const foodRegex = /<title>(\w{2} (?:\d\d?\.){2}\d{4})<\/title><description><!\[CDATA\[(Lounas) ?:? ?(.*?)<br>(Kasvislounas) ?:? ?(.*?)]]><\/description>/ +{ + const foodRegex = /<title>(\w{2} (?:\d\d?\.){2}\d{4})<\/title><description><!\[CDATA\[(Lounas) ?:? ?(.*?)(Kasvislounas) ?:? ?(.*?)]]><\/description>/gm; const foods = data.matchAll(foodRegex); for(const food of foods) { |