Skip to content

Makes the current Eskom load shedding stage available in several formats

License

Notifications You must be signed in to change notification settings

ashleyross/eskom-stages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eskom-stages

This small webapp exposes the current Eskom load shedding stage data in several formats.

It is written in C# and targets .NET Framework 4.5.1, although it will probably work just fine on lower versions too. It uses the Razor view engine with MVC 5 and Newtonsoft's Json.NET.

Compiling and Running

As this project was created in Visual Studio 2013, the simplest would be to use that to build it. If you don't have Visual Studio, you can get Visual Studio Community 2013 for free. Alternatively, you can try MonoDevelop, which is cross-platform.

Usage

Once the webapp is up and running, you can access the various output types the correct way, by varying the Accept header when requesting /, or the lazy way, by URL.

  • HTML - Accept: text/html or Accept: */* or by URL /html
  • JSON - Accept: application/json or Accept: text/json or by URL /json
  • XML - Accept: text/xml or Accept: application/xml or by URL /xml
  • Text - Accept: text/plain or by URL /text

You can see all this in action at http://load.27.am/

Notes

The data returned by this app is cached for 2 minutes if the call to the Eskom endpoint was successful. If unsuccessful, the data is cached for 5 seconds to avoid hammering the Eskom endpoint.

The Eskom endpoint in use? http://loadshedding.eskom.co.za/loadshedding/GetStatus

About

Makes the current Eskom load shedding stage available in several formats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published