For now, my /nycdata route does the data crunching and adds the events from ‘today’ to my database.
I also added a modal window with the event’s data that’s loaded via an AJAX call to the database. To do this, I created another API route to return just one event by it’s ID.
– either have /nycdata called once via a cron job at the beginning of the day
– check to see if today’s data has already been added to avoid duplicates.
– add a visual indicator that shows that data is being loaded via AJAX