Giter Site home page Giter Site logo

benlansdell / flying-overhead Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 5.0 357 KB

Announce flights of anything directly overhead.

License: MIT License

Makefile 0.15% Python 32.44% CSS 2.00% HTML 65.42%
flight-track flight-tracking flight-tracker opensky-api

flying-overhead's Introduction

Overhead

A simple demo web app designed to tell you what flights are directly overhead.

Setup

Copy private_keys_template.py to private_keys.py and fill in with your own details.

To run

FLASK_ENV=app flask run

Will run the app on localhost:5000.

What it does

Displays local planes in the air and (if unmuted) plays a sound whenever a plane is directly overhead, so you can quickly identify it.

How it does it

This flask/JS app queries the OpenSky REST API for local flight information using location information returned by IPStack. If the user gives permission, the page instead uses HTML5 geolocation for much more accurate location info. It generates a map using leaflet.js and MapBox.

This is only meant to be run locally, for your own amusement. You must update private_keys.py with your own API keys for these services to work.

screenshot

flying-overhead's People

Contributors

benlansdell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flying-overhead's Issues

JS opensky api call

Hi, I love the project, Thanks for helping me out bc I'm doing something similar :)
I found how to do the opensky api call from the browser, just leaving it in case anyone is interested

export async function getFlights( coords ) {
 
     // get the user's longitude and latitude
     const [ longitude, latitude ] = [ coords.longitude, coords.latitude ];
 
     // find the min and max longitude and latitude of the search area
     const kmPerDegreeLatitude  = 111.2
     const kmPerDegreeLongitude = 111.2 * Math.cos( latitude / 180 * Math.PI )
     const latitudeDegrees  = SEARCH_DISTANCE / kmPerDegreeLatitude
     const longitudeDegrees = SEARCH_DISTANCE / kmPerDegreeLongitude
 
     // build the query string
     const parameters = {
         lamin: latitude  - latitudeDegrees,
         lomin: longitude - longitudeDegrees,
         lamax: latitude  + latitudeDegrees,
         lomax: longitude + longitudeDegrees
     }
     const queryString = new URLSearchParams(parameters).toString();
 
     // make the request and set the openskyResponse variable
     const response = await fetch( OPENSKY_URL + "?" + queryString, {method: "GET", headers: HEADERS} );
     const openskyResponse = await response.json();

    return openskyResponse;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.