Download the PHP package chrishaensel/ivao-data without Composer
On this page you can find all versions of the php package chrishaensel/ivao-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chrishaensel/ivao-data
More information about chrishaensel/ivao-data
Files in chrishaensel/ivao-data
Package ivao-data
Short Description Simple PHP lib to download IVAO whazzup data while conforming to the IVAO rules. Please read their rules carefully!
License MIT
Informations about the package ivao-data
IVAO-Data
The IVAO data library is a very simple PHP class to download IVAO whazzup data.
IMPORTANT
This is work in progress! This is not the best code you will ever see. But it might help you. Good luck.
IVAO API Information
You can find more information on the IVAO API and the retrievval of the whazzup data in the IVAO wiki: IVAO WIKI auf.
Usage
- Clone this repo or composer-require it
git clone https://...
orcomposer require chrishaensel/ivao-data
- Create a new instance of the IVAO class
$ivao = new \chrishaensel\Ivao("My app name v.1.1");
- Download the data
$ivao->downloadIvaoWhazzupData();
Options
When instantiating the Ivao
class, you must pass your application's name as the first parameter.
$ivao = new \chrishaensel\Ivao("My app name v1.1")
, otherwise it will fail with an exception. IVAO requires you to pass your application name as User Agent
string when downloading the data.
As second parameter, you can pass an array
with other options.
Currently, the only supported option is create_json
. When set to 1
, the library will create a JSON
file of the ATC and PILOT data contained in the whazzupt.txt file.
When calling the downloadIvaoWhazzupData
method, you can pass a parameter (string
) with the target path / filename for the whazzup data.
$ivao->downloadIvaoWhazzupData("my_whazzup.txt"")
will cause the script to save the data in the file my_whazzup.txt
.
IVAO Rules
IVAO does have some rules regarding the download of whazzup data.
Most importantly:
These files may only be obtained after an official clearance from the IVAO Development Operations Department!
- Always set your user agent to the name of your application, including the version.
- The whazzup file may only be downloaded once every 5 minutes.
- The status.txt file may only be downloaded once a day
IVAO-data does take care of the timing - you need to ask for permission :)
Some sample code
This way, you can use the Ivao class. We're using naspaces, so there won't be conflicts with other libraries you might use.
Sample output of the JSON file
The whazzup data will be split in two parts within the JSON. "PILOT" and "ATC" - both are arrays of the connected parties.
Questions? Remarks?
- Contact me at [email protected].
- Find my website at https://haensel.pro.