simongray / el Goto Github PK
View Code? Open in Web Editor NEWDanish electricity price calendar.
Home Page: https://el.simongray.dk
Danish electricity price calendar.
Home Page: https://el.simongray.dk
webcal://
links seemingly do not work on Android. I am unsure whether they would work with clients other than Google's. I tried installing Outlook for Android (no account setup) and it didn't capture any intents from the browser. Google calendar apparently doesn't even support subscribing from the Android app, not even by typing in a URL.
In Chrome on macOS you can—I verified this—use a Google calendar URI to open directly in Google calendar, i.e. the link
will open the Google calendar web client and subscribe the Google user to the calendar.
Having a separate place to go for Google calendar requires having a separate submit button. This can be accomplished by setting a formaction on the extra submit button.
The simplest approach AFAIK is to create a basic web service that serves an ics
feed at some URL. A user can then subscribe to this URL at e.g. https://simongray.dk/el-priser
—or some version of that URL containing query-params to get a custom calendar feed. From how I read the—fairly sparse and dated—documentation it is up to the calendar software to keep these feeds updated via regular pulling.
So when a user accesses the website I basically need to do a network request to the API providing electricity prices (probably caching the result for n
minutes) to generate ics
data, serving this data via (probably) a Pedestal service with some basic rate limiting. That way the service can be kept completely open.
The other much more complex option is to make some service that integrates with Google Calendar, involving authentication etc. — I would definitely prefer not to go this route.
Not too hard, just need to format the numbers differently and write the correct translations. The only real novel work is having to use the templating features of Tongue.
When neither Danish nor English is specified, the language negotiation step will fail, resulting in a blank page. I'm speculating that this is why the Norwegian on Clojurians Slack couldn't get it working.
Since around 6th of June 2023 I get the following error when trying to fetch the calendar feed:
https://el.simongray.dk/calendar?language=da¤cy=DKK&max-price=1.00®ion=DK1
Internal server error: exception
Also seem like I can't get any new feed when using https://el.simongray.dk since no valid data is received when clicking "Subscribe".
Since this isn't built in to Caddy, several third party modules exist:
Not sure if this implies compiling the server from scratch...?
The web service consumes around a quarter of the available memory according to systemctl status el
(~250MB out of 1GB), Caddy only consumes ~20MB. Altogether, something like 56-58% of the droplet's total memory is being consumed in idle state. It should be possible bring the JVM memory consumption down significantly.
Some good advice available on Clojurians Slack: https://clojurians.slack.com/archives/C03S1KBA2/p1652169123478019
As suggested by a redditor: https://www.reddit.com/r/Denmark/comments/ukuixj/sparsommelig_s%C3%B8ndag_frugal_sunday_0805_2022/i7w1mui/
relative=true
on the API side.prices-below
function can be reused.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.