diff --git a/public/index.php b/public/index.php index 3f814c3..623bd9e 100644 --- a/public/index.php +++ b/public/index.php @@ -51,56 +51,58 @@ //Status $app->get('/status/:last/:vin/', function ($last, $vin) use ($app) { - //Get environment and DI - $env = $app->environment(); - $redis = $env['redis']; - - //Check redis cache for record - if ($cached = $redis->get($vin)) - { - //decode redis/JSON and pass it to VOTS class - $jeep = new VOTSService(json_decode($cached, TRUE)); - - - $data = array( - 'statusCode' => $jeep->getStatusCode(), - 'statusDesc' => $jeep->getStatusDesc(), - 'statusExplanation' => $jeep->getStatusExplanation() - ); - - //Do something - $app->render('response.twig', $data); - } - - //redis has no key, lets go fetch Chrysler's response - else - { - $jeep = new VOTSService(); - $jeep->getJSON($last, $vin); - if ($jeep->isValid()) - { - $data = array( - 'statusCode' => $jeep->getStatusCode(), - 'statusDesc' => $jeep->getStatusDesc(), - 'statusExplanation' => $jeep->getStatusExplanation() - ); - - //put json into redis on key=vin for caching - $redis->set($vin, json_encode($jeep::$decoded)); - $redis->expire($vin,60*20); //cache for 20 minutes - - //Do something - $app->render('response.twig', $data); - } - else - { - //set an error message to display, courtesy of Chrysler - $data = array( - 'error' => $jeep->getError() - ); - $app->render('error.twig', $data); - } - } + $app->redirect("/home/"); + + // //Get environment and DI + // $env = $app->environment(); + // $redis = $env['redis']; + + // //Check redis cache for record + // if ($cached = $redis->get($vin)) + // { + // //decode redis/JSON and pass it to VOTS class + // $jeep = new VOTSService(json_decode($cached, TRUE)); + + + // $data = array( + // 'statusCode' => $jeep->getStatusCode(), + // 'statusDesc' => $jeep->getStatusDesc(), + // 'statusExplanation' => $jeep->getStatusExplanation() + // ); + + // //Do something + // $app->render('response.twig', $data); + // } + + // //redis has no key, lets go fetch Chrysler's response + // else + // { + // $jeep = new VOTSService(); + // $jeep->getJSON($last, $vin); + // if ($jeep->isValid()) + // { + // $data = array( + // 'statusCode' => $jeep->getStatusCode(), + // 'statusDesc' => $jeep->getStatusDesc(), + // 'statusExplanation' => $jeep->getStatusExplanation() + // ); + + // //put json into redis on key=vin for caching + // $redis->set($vin, json_encode($jeep::$decoded)); + // $redis->expire($vin,60*20); //cache for 20 minutes + + // //Do something + // $app->render('response.twig', $data); + // } + // else + // { + // //set an error message to display, courtesy of Chrysler + // $data = array( + // 'error' => $jeep->getError() + // ); + // $app->render('error.twig', $data); + // } + // } }); @@ -109,23 +111,15 @@ $jeep = new VOTSService(); $jeep->getJSON($last, $vin); - if ($jeep->isValid()) - { - $data = array( - 'JSON' => $jeep::$raw - ); - //Do something - $app->render('debug.twig', $data); - } - else - { - //set an error message to display, courtesy of Chrysler - $data = array( - 'error' => $jeep->getError() - ); - $app->render('error.twig', $data); - } + $data = array( + 'JSON' => $jeep::$raw + ); + + //Do something + $app->render('debug.twig', $data); + + }); diff --git a/views/application.twig b/views/application.twig index f25aa6a..25eacbb 100644 --- a/views/application.twig +++ b/views/application.twig @@ -57,7 +57,7 @@
- Comments? Broken? Email me. Read about changes here. + Comments? Email me. Read about changes here.
Changelog
+
+ 0.Dead
+ Dead. Chrysler wants to control you with their crappy software.
+
0.2
diff --git a/views/home.twig b/views/home.twig
index f83872d..84a456a 100644
--- a/views/home.twig
+++ b/views/home.twig
@@ -3,6 +3,17 @@
{% block container %}
They say all good things must come to an end, and it appears that Jeepstatus' time has come. Chrysler has decided to add a random number generator to it's VOTS system to disallow the reused of URLs. If you're not a geek like me I'll make that more plain: Chrsyler doesn't want you to use JeepStatus or any other means of seeing into the backend of their VOTS system. In fact, you can't even save your backend URL anymore as it will expire and be unusable.
+ +If Chrysler's web team had designed a nice, simple, usuable tool from the beginning there would have been no need for JeepStatus to exist. (For the geeks, they didn't even use proper JSON responses)
+ +So farewell, and may your Jeep see more dirt than pavement.
+ +To Chrysler, please take my code. Make something usuable out of VOTS instead of the crap you provide.
+ +