biometrics
Honorary Master
- Joined
- Aug 7, 2003
- Messages
- 71,856
- Reaction score
- 2,239
And that's why I posted to confirm.Hence he said -1 at the end.
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
And that's why I posted to confirm.Hence he said -1 at the end.
I'd love to make use of an API like this. The amount of people in my neighbourhood watch group who don't know how to interpret the schedule is staggering.
I'm sure I can slap an android app together in a couple of minutes if only I can find an API. I don't have the time and energy to scrape for something which I'm not ggoing to get paid for![]()
If I had 0.000000001c for every person that asked for a loadshedding schedule (which hasn't changed by us in several years) I would be a millionaire just for today.
How does this compare to something like the HTML Agility pack in terms of usability? The one issue I had with the HTML Agility pack was that it only really works on a completely loaded document and won't trigger scripts to load the dynamic bits.You're better off using Beautiful Soup and scraping data off twitter, I am not sure if BS can scrape location information from tweets. Whether or not geo-local is displayed is, is the users choice and not Twitter's.
How does this compare to something like the HTML Agility pack in terms of usability? The one issue I had with the HTML Agility pack was that it only really works on a completely loaded document and won't trigger scripts to load the dynamic bits.
[{"MunicipalityName":"City of Johannesburg",... "Id":1020571,"Total":405},
{"MunicipalityName":"City of Johannesburg",..."Id":1020572,"Total":135},
{"MunicipalityName":"City of Johannesburg",... "Id":1020573,"Total":270}]
Thu, 12 Dec
08:00 - 12:30
Fri, 13 Dec
00:00 - 04:30
Sat, 14 Dec
-
Sun, 15 Dec
00:00 - 04:30
16:00 - 20:30
Mon, 16 Dec
-
Tue, 17 Dec
12:00 - 16:30
Wed, 18 Dec
04:00 - 08:30

What are the other parameters and there is also cache busting taking place?Selenium FTFW!
Anyway, if you are an Eskom customer you can just check the AJAX calls their site makes and skip firing up a browser instance to scrape HTML content that's generated client side.
Example:
\http://loadshedding.eskom.co.za/LoadShedding/FindSuburbssearchText=Broadacres+AH&maxResults=300
Code:[{"MunicipalityName":"City of Johannesburg",... "Id":1020571,"Total":405}, {"MunicipalityName":"City of Johannesburg",..."Id":1020572,"Total":135}, {"MunicipalityName":"City of Johannesburg",... "Id":1020573,"Total":270}]
Use one of the records' ID and loadshedding stage as parameters:
\http://loadshedding.eskom.co.za/LoadShedding/GetScheduleM/1020571/2/3/405?_=1576127221434
And you'll get some HTML you can scrape which renders to this:
Code:Thu, 12 Dec 08:00 - 12:30 Fri, 13 Dec 00:00 - 04:30 Sat, 14 Dec - Sun, 15 Dec 00:00 - 04:30 16:00 - 20:30 Mon, 16 Dec - Tue, 17 Dec 12:00 - 16:30 Wed, 18 Dec 04:00 - 08:30
What are the other parameters and there is also cache busting taking place?
A simple script recording when your UPS kicks in would probably be more helpfulThing is its never accurate which sucks. If you guys could develop and accurate app that would be cool
[{"Selected":false,"Text":"Beaufort West","Value":"10237"},{"Selected":false,"Text":"Bergrivier","Value":"10238"},{"Selected":false,"Text":"Bitou","Value":"10239"},{"Selected":false,"Text":"Breede Valley","Value":"10240"},{"Selected":false,"Text":"Cape Agulhas","Value":"10241"},{"Selected":false,"Text":"Cederberg","Value":"10242"},{"Selected":false,"Text":"City of Cape Town","Value":"10243"},{"Selected":false,"Text":"Drakenstein","Value":"10244"},{"Selected":false,"Text":"George","Value":"10245"},{"Selected":false,"Text":"Hessequa","Value":"10246"},{"Selected":false,"Text":"Kannaland","Value":"10247"},{"Selected":false,"Text":"Knysna","Value":"10248"},{"Selected":false,"Text":"Laingsburg","Value":"10249"},{"Selected":false,"Text":"Langeberg","Value":"10250"},{"Selected":false,"Text":"Matzikama","Value":"10251"},{"Selected":false,"Text":"Mossel Bay","Value":"10252"},{"Selected":false,"Text":"Oudtshoorn","Value":"10253"},{"Selected":false,"Text":"Overstrand","Value":"10254"},{"Selected":false,"Text":"Prince Albert","Value":"10255"},{"Selected":false,"Text":"Saldanha Bay","Value":"10256"},{"Selected":false,"Text":"Stellenbosch","Value":"10257"},{"Selected":false,"Text":"Swartland","Value":"10258"},{"Selected":false,"Text":"Swellendam","Value":"10259"},{"Selected":false,"Text":"Theewaterskloof","Value":"10260"},{"Selected":false,"Text":"Witzenberg","Value":"10261"}]
{"Total":111,"Results":[{"id":"1061253","text":"Afdak","Tot":267},{"id":"1069253","text":"Albertyn","Tot":535},{"id":"1061254","text":"Avila","Tot":0},{"id":"1061255","text":"Avoca","Tot":268},{"id":"1061256","text":"Baardskeerdersbos","Tot":268},{"id":"1061257","text":"Betty\u0027s Bay","Tot":268},{"id":"1061258","text":"Birkenhead","Tot":0},{"id":"1061259","text":"Blompark","Tot":0},{"id":"1061260","text":"Boesmansrivier","Tot":268},{"id":"1061261","text":"Bovendrift","Tot":268},{"id":"1061262","text":"Braemar","Tot":268},{"id":"1061263","text":"Bruinklip","Tot":268},{"id":"1061264","text":"Buffeljacht","Tot":272},{"id":"1069254","text":"Dagbreek","Tot":534},{"id":"1069255","text":"De Hoop","Tot":267},{"id":"1061265","text":"De Kelders","Tot":0},{"id":"1061266","text":"De Kelders 2","Tot":0},{"id":"1061267","text":"De Kelders 3","Tot":0},{"id":"1069256","text":"Denniston","Tot":267},{"id":"1061268","text":"Die Dam","Tot":272},{"id":"1061269","text":"Dirkuyskraal","Tot":272},{"id":"1061270","text":"Doringbosch","Tot":268},{"id":"1061271","text":"Duinefontein","Tot":0},{"id":"1061272","text":"Eluxolweni","Tot":0},{"id":"1061273","text":"Ertjiesvlei","Tot":268},{"id":"1061274","text":"Fisantskraal","Tot":272},{"id":"1061275","text":"Fisherhaven","Tot":267},{"id":"1061276","text":"Franskraal Strand","Tot":268},{"id":"1061277","text":"Gans Bay","Tot":536},{"id":"1061278","text":"Goedetrouw","Tot":268},{"id":"1061279","text":"Groenewaldskema","Tot":0},{"id":"1061280","text":"Groot Hagelkraal","Tot":0},{"id":"1061281","text":"Grootbos","Tot":268},{"id":"1061282","text":"Grootvlei","Tot":268},{"id":"1061283","text":"Hagelkraal","Tot":0},{"id":"1061284","text":"Hangklip","Tot":268},{"id":"1061285","text":"Hawston","Tot":0},{"id":"1061286","text":"Helderfontein","Tot":0},{"id":"1061287","text":"Hermanus","Tot":2412},{"id":"1061288","text":"Hermanus Outlying","Tot":0},{"id":"1061289","text":"High Noon","Tot":267},{"id":"1061290","text":"Honigsklip","Tot":268},{"id":"1061291","text":"Hoopjesrivier","Tot":267},{"id":"1061292","text":"Houhoek","Tot":267},{"id":"1061293","text":"Karwyderskraal","Tot":268},{"id":"1061294","text":"Kleinbaai","Tot":0},{"id":"1061295","text":"Kleinmond","Tot":536},{"id":"1061296","text":"Kleinrivierkloof","Tot":268},{"id":"1061297","text":"Klipfontein","Tot":0},{"id":"1061298","text":"Koksrivier","Tot":272},{"id":"1061299","text":"Kouderivier","Tot":268},{"id":"1061300","text":"Kouevlakte","Tot":268},{"id":"1069257","text":"Kromvlei","Tot":267},{"id":"1061301","text":"Lamloch","Tot":268},{"id":"1061302","text":"Langkloof","Tot":0},{"id":"1061303","text":"Le Mercy","Tot":268},{"id":"1069258","text":"Lebanon","Tot":267},{"id":"1061304","text":"LObos","Tot":0},{"id":"1061305","text":"Masakhane","Tot":0},{"id":"1061306","text":"Modderrivier","Tot":268},{"id":"1061307","text":"Moeraskloof","Tot":268},{"id":"1061308","text":"Mosselrivier","Tot":0},{"id":"1061309","text":"Mount Pleasant","Tot":0},{"id":"1061310","text":"New Granton","Tot":268},{"id":"1061311","text":"Nuwedam","Tot":268},{"id":"1061312","text":"Nuwepos","Tot":268},{"id":"1061313","text":"Onrus","Tot":535},{"id":"1061314","text":"Oudebosch","Tot":268},{"id":"1061315","text":"Paardenberg","Tot":268},{"id":"1061316","text":"Papiesvlei","Tot":268},{"id":"1061317","text":"Pearly Beach","Tot":0},{"id":"1061318","text":"Perlemoenbaai","Tot":0},{"id":"1061319","text":"Pringle Bay","Tot":268},{"id":"1061320","text":"Protea","Tot":0},{"id":"1061321","text":"Ratelrivier","Tot":272},{"id":"1061322","text":"Rooiels Bay","Tot":268},{"id":"1069259","text":"Salandra","Tot":268},{"id":"1061323","text":"Sandbaai","Tot":268},{"id":"1061324","text":"Sandberg","Tot":268},{"id":"1069260","text":"Sandfontein","Tot":272},{"id":"1061325","text":"Sandhoogte","Tot":268},{"id":"1061326","text":"Sandy\u0027s Glen","Tot":268},{"id":"1061327","text":"Silversands","Tot":268},{"id":"1061328","text":"Somerset West NU","Tot":0},{"id":"1061329","text":"Spookfontein","Tot":536},{"id":"1061330","text":"Stanford","Tot":804},{"id":"1061331","text":"Stompieskloof","Tot":0},{"id":"1061332","text":"Strands Kloof","Tot":268},{"id":"1061333","text":"Sunny Seas Estate","Tot":268},{"id":"1061334","text":"Sunnydale","Tot":804},{"id":"1061335","text":"The Springs","Tot":0},{"id":"1061336","text":"Tierfontein","Tot":268},{"id":"1061337","text":"Tweefontein","Tot":268},{"id":"1061338","text":"Uilenkraal","Tot":268},{"id":"1061339","text":"Uilenkraalsmond","Tot":268},{"id":"1061340","text":"Uitkoms","Tot":268},{"id":"1061341","text":"Van Dyksbaai","Tot":0},{"id":"1061342","text":"Vermont","Tot":267},{"id":"1061343","text":"Viljoenshof","Tot":272},{"id":"1069261","text":"Vredendal","Tot":268}]}