Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking to use your API #5

Open
silent001 opened this issue Nov 18, 2023 · 1 comment
Open

Looking to use your API #5

silent001 opened this issue Nov 18, 2023 · 1 comment

Comments

@silent001
Copy link

I have written a script for my home server to turn off when the power in my area is about to go off however I have been looking for a way to get the "outlook" much like most load shedding apps do as I often have a timeslot that is scheduled only when the stages go up at 16H00 and then as a result my server does not turn off when it should as the https://loadshedding.eskom.co.za/LoadShedding/GetStatus takes about 7-10 minutes to update.

I want to not abuse your endpoint but do want up to date info on the outlook for load shedding. How often do you update the calendars and is there a programmatic way I can check for an update and only then do an API request to your endpoint for the latest schedule?

My linux repo for this can be found below:
https://github.com/silent001/LoadShedding

@beyarkay
Copy link
Owner

Hi there,

Apologies for the late reply. You can just use it 👍 No stress about rate limits or whatnot (so long as you're not going crazy making a request every second or something). I'm going to add a "Has loadshedding been updated" endpoint in the near future (december/january) but for now it doesn't exist so the best solution is to check every hour or so for an update.

The schedules are updated manually by myself, usually within 10 minutes of an update being announced by Eskom (there's no automatic way to do this unfortunately). Once I update the schedules, the calendars and API are updated within 2 minutes.

If you really want to get the latest details as soon as their available, you could try to setup a script to listen for changes to the file https://github.com/beyarkay/eskom-calendar/blob/main/manually_specified.yaml (since this is the file I update with the new schedules). There should be a way to get a github webhook that sends a POST request to an endpoint you specify every time the file gets updated, but I haven't looked into it too much myself since I'm hoping to write the official API endpoint soon.

Hope that helps! and I'm glad the API is useful to you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants