Last active
August 1, 2019 13:55
-
-
Save Firefishy/b7d2f50853d7b27a3bcb to your computer and use it in GitHub Desktop.
live gautrain bus position api - reverse engineered
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date_default_timezone_set('UTC'); | |
function getURL() { | |
$paramString2 = 'east=XXX&south=-XXX&north=-XXX&west=XXX'; | |
$paramString1 = 'gautrain.mobileServer.getBusesByBoundingBoxServlet'; | |
$timestamp = (string) time(); | |
$signature = base64_encode(hash_hmac('sha1', $paramString2 . '/' . $paramString1. '/2a93a1b6be/' . $timestamp, '@GAuTra1n', true)); | |
$signature = str_replace(array('=', '/', '+'), array(' ','_','-'), $signature); | |
$signature = trim($signature); | |
$url = 'https://saas.afrigis.co.za/rest/2/'.$paramString1.'/2a93a1b6be/'.$signature.'/'.$timestamp.'/?'.$paramString2; | |
return $url; | |
} |
More info see: http://firefishy.com/tmp/bus/
Secret used for signature has been updated. Email me.
New API launched beginning of May 2018 is much simpler:
curl -d '{"east":"28.9414", "south":"-26.3258", "north":"-25.0488", "west":"27.6591"}' -H "Content-Type: application/json" -X POST https://api.gautrain.co.za/transport-api/api/0/busses/location
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take downs to: shame-on-you AT firefishyDOTcom