seriouslysean / monster-hunter-now-events

A tool that auto-generates calendar events for Monster Hunter Now by scraping web news articles, processing them with AI, and creating a convenient calendar subscription.
https://seriouslysean.github.io/monster-hunter-now-events/
MIT License
9 stars 9 forks source link

[Feature]: Improve index.html #32

Closed seriouslysean closed 11 months ago

seriouslysean commented 11 months ago

Feature Description

Create a better, static page experience based on the events we have. For instance, it would be nice to have:

Inline CSS and JS will probably work fine. We'll likely need some logic to parse the events.json file to figure out the current date. Then we'd need to parse that event from the JSON and show it in a timezone agnostic way (since an event from 1-4pm happens at 1-4pm regardless of timezone).

That means the only important bit of information is the current date which the browser will provide.

y-ashaswini commented 11 months ago

Please assign this issue to me!

seriouslysean commented 11 months ago

Thanks @y-ashaswini, looking forward to seeing it. Let me know if you need any help! You can probably get away with inline JS and CSS in the index.html for this particular implementation. Certainly not against a more robust solution though!

y-ashaswini commented 11 months ago

Thank you for the assignment! @seriouslysean, I see that once I run your commands, within a few seconds, the calendar has been generated and the events.json file is updated. As I understand it, you want a static html page (with styling of course) to visualise all this in a nice way. But there is currently no hosting being done as such, so I guess I'll have to set up at least a home route to run and display the html page on the web port first, and perhaps have a few buttons that do the job of initiating the fetching, downloading and generating files, is that right? Please confirm!

Cheers, yashaswini

seriouslysean commented 11 months ago

Hosting is actually done on GitHub for free via GitHub pages. That's the purpose of the index.html in the root.

As of right now it's just a redirect to the repository README but could just as easily be updated to be a built page via some sort of build system, or just by making updates to that index.html file.

This also means that you'd be able to import dist/events.json file and infer the current event with some sort of utility.

The deployment happens automatically when main is updated, and eventually I'll have the repo auto update on a daily schedule.

y-ashaswini commented 11 months ago

Oh right, understood. I've opened a pull request right now where I've directly hosted HTML content from the server script itself, not using index.html or anything else. It reads directly from events.json and outputs formatted and stylized HTML on port number 8080.

seriouslysean commented 11 months ago

Resolved by #43