Updated places extractor

This commit is contained in:
drobnikj 2019-01-08 09:49:45 +01:00
parent d0bea52177
commit ce135fb8e8

View File

@ -46,7 +46,7 @@ const extractPlaceDetail = async (page) => {
// Finds values from y axis // Finds values from y axis
$(this).find('.section-popular-times-bar').each(function (barIndex) { $(this).find('.section-popular-times-bar').each(function (barIndex) {
const occupancyMatch = $(this).attr('aria-label').match(/\d+\s+?%/); const occupancyMatch = $(this).attr('aria-label').match(/\d+\s+?%/);
if (occupancyMatch) { if (occupancyMatch && occupancyMatch.length) {
const maybeHour = graphStartFromHour + barIndex; const maybeHour = graphStartFromHour + barIndex;
graphs[day].push({ graphs[day].push({
hour: maybeHour > 24 ? maybeHour - 24 : maybeHour, hour: maybeHour > 24 ? maybeHour - 24 : maybeHour,