What's flying over the City of Charlottesville, Virginia?
Twitter bot which uses the ADS-B Exchange API to spot aircraft within a 2.5nm radius of the City of Charlottesville, VA (38.0375, -78.4863). Timestamps for each spotting are persisted to a Firebase Realtime Database.
- Clone or download this repo and open the
above-cville
directory.
- Create a Firebase Project using the Firebase Developer Console
- Install Firebase CLI Tools if you have not already, and log in with
firebase login
. - Configure the bot to use your project using
firebase use --add
and select your project.
-
Install dependencies by running:
npm install
-
Provide the following environment variables in your .env file:
ADSBX_KEY="api-key-here" FIREBASE_PROJECT_ID="my-app" FIREBASE_PRIVATE_KEY="private-key-here" FIREBASE_CLIENT_EMAIL="firebase-adminsdk@my-app.iam.gserviceaccount.com" DB_URL="https://my-app.firebaseio.com" TWITTER_ACCESS_TOKEN="access-token-here" TWITTER_ACCESS_TOKEN_SECRET="access-token-secret-here" TWITTER_CONSUMER_KEY="consumer-key-here" TWITTER_CONSUMER_SECRET="consumer-secret-here"
Further reading:
There are a number of variables which can be customized by modifying config.js
actionPhrases
- short phrases to add to the beginning of the tweetrefreshSeconds
- how often to call the ADS-B endpointcooldownMinutes
- amount of time that should pass before spotting the same aircraftmaximumAlt
- filter out aircraft above this altitudeabbreviations
- abbreviations that should be kept uppercasearticles
- exceptions where a plane type should be anAn
instead of anA
and vice versaairport.dataUrl
- URL for thumbnail endpointadsbx.url
- URL for ADS-B endpointadsbx.lat
- latitude value used for geolocationadsbx.lon
- longitude value used for geolocationadsbx.radius
- radius for search in nautical miles
above-cville
relies on two static JSON files for aircraft types (storage/aircrafts.json
) and operators (storage/operators.json
) data. These files are regularly updated and can be downloaded from https://github.com/Mictronics/readsb-protobuf/tree/dev/webapp/src/db manually or through a cron job.
To start the bot, run the following in the project directory:
npm start
To run the included unit tests:
npm test
- AboveTustin - ADS-B Twitter Bot. Uses dump1090-mutability to track airplanes and then tweets whenever an airplane flies overhead.