Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrcgrtz/flight-durations
✈️ Get actual flight durations using timezone information from OpenFlights.org.
https://github.com/mrcgrtz/flight-durations
flight-durations openflights timezone-information
Last synced: 23 days ago
JSON representation
✈️ Get actual flight durations using timezone information from OpenFlights.org.
- Host: GitHub
- URL: https://github.com/mrcgrtz/flight-durations
- Owner: mrcgrtz
- License: mit
- Created: 2016-10-31T17:06:01.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-11-08T08:47:25.000Z (about 2 months ago)
- Last Synced: 2024-12-08T05:45:25.014Z (28 days ago)
- Topics: flight-durations, openflights, timezone-information
- Language: PHP
- Homepage:
- Size: 578 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flight Durations (PHP)
Get actual flight durations using [timezone information](https://openflights.org/data.html) provided by OpenFlights.org.
## Required parameters
* `from` = departure datetime, i.e. `2016-11-10T16:25`
* `to` = arrival datetime, i.e. `2016-11-10T20:40`
* `departureAirport` = 3-letter IATA code of departure airport, i.e. `AMS`
* `destinationAirport` = 3-letter IATA code of destinationairport, i.e. `MIA`## Sample requests
Start the builtin server using:
```shell
php -S localhost:9000 -t htdocs
```Using [Curlie](https://github.com/rs/curlie):
```shell
$ curlie http://localhost:9000/ from==2016-11-10T16:25 to==2016-11-10T20:40 departureAirport==AMS destinationAirport==MIA
{
"duration": "P0DT10H15M",
"from": "2016-11-10T16:25+01:00",
"to": "2016-11-10T20:40-05:00"
}$ curlie http://localhost:9000/ from==2016-12-14T13:50 to==2016-12-15T06:50 departureAirport==ZRH destinationAirport==HKT
{
"duration": "P0DT11H0M",
"from": "2016-12-14T13:50+01:00",
"to": "2016-12-15T06:50+07:00"
}
```