|
|
|
|
@ -2,7 +2,7 @@ import { get_upcoming_events } from '../src/hoopla/index.mjs';
|
|
|
|
|
import send from '../src/signal/send.mjs'; |
|
|
|
|
import fetch from 'node-fetch'; |
|
|
|
|
|
|
|
|
|
const prod = false; |
|
|
|
|
const prod = true; |
|
|
|
|
|
|
|
|
|
let api, token; |
|
|
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ const updated = (oldEvent, scrapedEvent) => {
|
|
|
|
|
]; |
|
|
|
|
for (let key of keys) { |
|
|
|
|
if (oldEvent[key] != scrapedEvent[key]) { |
|
|
|
|
console.log(124, oldEvent[key], '!=', scrapedEvent[key]); |
|
|
|
|
console.log(124, key, oldEvent[key], '!=', scrapedEvent[key]); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -87,10 +87,11 @@ const updated = (oldEvent, scrapedEvent) => {
|
|
|
|
|
end: unix(new Date(event.end)), |
|
|
|
|
start: unix(new Date(event.start)), |
|
|
|
|
draft: false, |
|
|
|
|
hoopla_id: event.event_id, |
|
|
|
|
hoopla_id: `${event.event_id}`, |
|
|
|
|
facebook_id: '', |
|
|
|
|
place_id: place.id, |
|
|
|
|
name: event.name ?? '', |
|
|
|
|
ticket_url: `https://${hoopla_name_id}.hoopla.no/sales/${event.event_id}` |
|
|
|
|
ticket_url: `https://${place.hoopla_name_id}.hoopla.no/sales/${event.event_id}` |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (payloads.length == 0) { |
|
|
|
|
@ -104,6 +105,7 @@ const updated = (oldEvent, scrapedEvent) => {
|
|
|
|
|
console.log(500, await search.text()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
search = await search.json(); |
|
|
|
|
let new_event = search.length === 0; |
|
|
|
|
let old_event; |
|
|
|
|
|