Tom Posted December 13, 2010 Report Share Posted December 13, 2010 Hi all, I'm looking to make a script to run as an equivalent to that of FSACARS/kACARS etc which instead gets data from online xml feed(s). I just want to be able to feed the live map from it and compile & automatically send PIREPS to the system when they're completed. After looking through the FSACARS and kACARS scripts in the modules folder I'm still not really picking up how I would do it. Would anyone be able to explain how the process works, what files are involved and what data will need to be provided? Thanks Quote Link to comment Share on other sites More sharing options...
Tom Posted December 14, 2010 Author Report Share Posted December 14, 2010 Can't anyone help? Not even explain how the ACARS system works and which files I need? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 19, 2010 Administrators Report Share Posted December 19, 2010 Basically you create a script, and you can create it as a module. Your app has to hit that module (or a cron or something if you're reading a feed), where that code gets run. You need to call one of the ACARSData functions, to file a PIREP or update an actual flight status. To do that, you fill in a data structure and pass it to it. For example, kACARS is updating a status of a flight: https://github.com/nshahzad/phpVMS/blob/master/core/modules/kACARS_Free/kACARS_Free.php#L179 There's that array, which get's passed to UpdateFlightData(). So perhaps it will be something like simplexml_load_data('your feed url'), and then filling out that data structure and passing it to UpdateFlighData. FilePIREP is similar: https://github.com/nshahzad/phpVMS/blob/master/core/modules/kACARS_Free/kACARS_Free.php#L255 Quote Link to comment Share on other sites More sharing options...
Tom Posted December 20, 2010 Author Report Share Posted December 20, 2010 Right ok, so seeing as I'm doing it with XML rather than an actual program I'm going to have to set a cron to run the script? How often should that run? I believe my host sets a limit to 15 minutes - would that be a problem do you think? I think I have an fair idea for how to do it now. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 20, 2010 Administrators Report Share Posted December 20, 2010 Right ok, so seeing as I'm doing it with XML rather than an actual program I'm going to have to set a cron to run the script? How often should that run? I believe my host sets a limit to 15 minutes - would that be a problem do you think? I think I have an fair idea for how to do it now. Yeah, 15 minutes is OK. You can set WGET or curl as a script to call yoursite.com/index.php/module/retrieve, where this will run this code: class Module extends CodonModule { public function retreive() { // your XML parsing code in here, $cws = new CodonWebService(); $xml = simplexml_load_string($cws->get ('URL to your XML')); // continue } } And you can do all your parsing, etc there as if it's a regular ACARS module Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.