skymeyer / vatsimphp Goto Github PK
View Code? Open in Web Editor NEWVatsimphp - VATSIM data parser
Home Page: http://skymeyer.github.io/Vatsimphp/
License: Apache License 2.0
Vatsimphp - VATSIM data parser
Home Page: http://skymeyer.github.io/Vatsimphp/
License: Apache License 2.0
Hi Jelle,
Small difference (in my case BC) I found from upgrading from V2 to V2.0.2, based on my current code expecting there to always be planned_*
attributes.
If the pilot's flight plan is null, some of the planned_
attributes seem to be missing on the pilot data object, where as previously I believe they we included blank (i.e. 'planned_depairport' => ''
)
Example:
Raw from VATSIM Datafeed v3
{"cid":1468017,"name":"Henry Trujillo KASH","callsign":"N550JG","server":"USA-EAST","pilot_rating":0,"latitude":42.78035,"longitude":-71.51487,"altitude":193,"groundspeed":0,"transponder":"1200","heading":211,"qnh_i_hg":29.72,"qnh_mb":1006,"flight_plan":null,"logon_time":"2021-01-04T19:50:05.0681001Z","last_updated":"2021-01-05T12:54:56.4542793Z"}
Received output from a dd inside $vatsim->getPilots()->each(function ($pilot) ...
^ array:15 [▼
"callsign" => "N550JG"
"cid" => "1468017"
"realname" => "Henry Trujillo KASH"
"latitude" => "42.78035"
"longitude" => "-71.51487"
"altitude" => "193"
"groundspeed" => "0"
"server" => "USA-EAST"
"rating" => "0"
"transponder" => "1200"
"time_logon" => "20210104195005"
"heading" => "211"
"QNH_iHg" => "29.72"
"QNH_Mb" => "1006"
"clienttype" => "PILOT"
]
Build is failing on Bamboo related to date time conversion:
07-Oct-2013 15:40:36 PHPUnit 3.7.27 by Sebastian Bergmann.
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 Configuration read from /home/bamboo/bamboo-home/xml-data/build-dir/VAT-NB-JOB1/phpunit.xml.dist
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 ............................................................... 63 / 164 ( 38%)
07-Oct-2013 15:40:36 .....................F......................................... 126 / 164 ( 76%)
07-Oct-2013 15:40:36 ......................................
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 Time: 450 ms, Memory: 7.75Mb
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 There was 1 failure:
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 1) Vatsimphp\DataParserTest::testConvertTs with data set #0 ('20130601000000', 1370044800)
07-Oct-2013 15:40:36 Failed asserting that 1370059200 is identical to 1370044800.
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 /home/bamboo/bamboo-home/xml-data/build-dir/VAT-NB-JOB1/tests/Vatsimphp/Parser/DataParserTest.php:176
07-Oct-2013 15:40:36 /usr/share/php5/PEAR/PHPUnit/TextUI/Command.php:176
07-Oct-2013 15:40:36 /usr/share/php5/PEAR/PHPUnit/TextUI/Command.php:129
07-Oct-2013 15:40:36
07-Oct-2013 15:40:36 FAILURES!
07-Oct-2013 15:40:36 Tests: 164, Assertions: 287, Failures: 1.
07-Oct-2013 15:40:36
Since the data feed is now available as JSON and has more distinct and cleaned up data points, we should expose these directly using objects for better flexibility and ease of use.
See https://github.com/skymeyer/Vatsimphp/blob/master/src/Vatsimphp/Sync/AbstractSync.php#L525
We don't have an active test which validates skipping the timestamp test in cacheOnly mode.
Since the last update, the format of datetime has changed and is no longer the format my tool expects to use.
Let me know if you need me to paste items from discord here.
Cache only flag is available but it's a doing-nothing-machine for now. To avoid inline data downloads we want to split off this process using VatsimData::config['cacheOnly'].
Seems like the output is not stored in UTF-8. In vatsim-data.json
I find eg. this (even though my editor opens it as UTF-8):
"name": "Soulié LFJL",
"callsign": "FCYJMS",
A copy attached
vatsim-dataCOPY.zip
Add command line wrappers for cron jobs.
My code currently looks like this:
https://pastebin.com/dt73rn4T
And every time I try to run it I'm getting:
Fatal error: Call to a member function search() on null in /home/vatsim/html/stands/vendor/skymeyer/vatsimphp/src/Vatsimphp/VatsimData.php on line 291.
I can't extract any pilots nor controllers.
Looking at the code for the v3 parser, it only looks at objects within the controllers
and pilots
blocks, and ignores the atis
block.
Would it be possible to have ATIS data added?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.