Git Product home page Git Product logo

mypowerstats's Introduction

mypowerstats

Retrieve information from the Eskom API

##What's going on here? This code makes a query to the myeskom.co.za website and pulls out the publically available information. Nothing funny is going on here, its just a different way to display the information that Eskom has made available

##Why?

I wanted something that displayed a simple 2-line summary. No fancy webapp, no icons. Just text

##Getting data thats relevant to you

You will need two pieces of information from the myeskom.co.za website in order for this to work. To get these pieces of information:

  1. Go to http://www.myeskom.co.za/
  2. Register an account (click on the top left icon -> My profile)
  3. Open your web browsers Developer console, go to the Network tab.
  4. Go back to the dashboard (top left icon -> Dashboard)
  5. Scroll through the Network requests, look for a POST to 24?=, Click it
  6. Select the Params subtab
  7. Copy the authKey and city values
  8. Put authKey and city into the mypowerstats scripts in place of the bogus values

##What you'll get

The response from the myeskom site is a JSON Object.

In the object you'll find some useful things, and some useless things

Useful:

  • 'status' = Power Alert Status (Eskom's colour index of grid status)
  • 'level' = Power Level (Eskom's way of stating the grid load)
  • 'levelstatus' = Power Trend (Trend of the load. Up/Down/Stable)

Sort of useful:

  • 'location' = Location (incase you forgot)
  • 'tmp' = Outside Temperature (Celcius)
  • 'appliances' = An Array of Appliances that Eskom thinks you should turn off
    • 'name' = Name of the appliance you should turn off

Useless:

  • 'nextloadsheddingdate' = Next Load Shedding Date (I've never seen this populated. It's always null)
  • 'tiptitle' and 'tipofday' = Eskom gives you helpful Tips on saving electricity. Like using a blanket instead of a heater.

##License

This code is released under The MIT License (MIT).

##Credits

Written and maintained by Kieran Murphy [email protected]

If you find this helpful in any way and you want to say thanks, feel free to donate Bitcoin at 1Eyr72dHQs3RCo1tpXDeccyxjzqyXdYvuH

Thanks!

mypowerstats's People

Contributors

daffster avatar froztbyte avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.