Sign inSign up

plck/twitterflightbot

By plck

•Updated about 3 years ago
Archived

A Twitter bot that tells you information about a flight by it's number or callsign.

Image
0

890

plck/twitterflightbot repository overview

⁠Twitter Flight Bot

Link to the GitHub repository⁠

This bot will return information about a flight when you tag it with its flight number or its callsign. To use it, you need to tag it by its Twitter handle and follow with a flight number / callsign like so: .@YourTwitterBot U2189.

The bot will reply to you with the following information:

  • The airline name with the flight number / callsign
  • The origin airport name
  • The actual departure time in UTC timezone
  • The arrival airport name
  • The Estimated Time of Arrival in UTC timezone
  • The altitude in feet

Be aware that the flight must be active for the bot to work, meaning the plane's transponder must be on.

The code is written in Python and uses Tweepy⁠ for the Twitter connection and FlightRadarAPI⁠ for the Flghtradar24 API. This bot is not affiliated with Flightradar24⁠ in any way.

⁠Setup

To run the code yourself, you will need to create an App on the Twitter Developer Portal⁠ and generated your tokens to be able to use the API.

⁠Use the Docker image

A Docker image⁠ is available for this project, which makes it easier for production environment and is the method I would recommend. You will first need to have Docker⁠ and Docker Compose⁠ installed on your machine for this to work.

First, cd into this repository:

cd ./TwitterFlightBot

Then, edit the docker-compose.yml file with your Twitter API credentials:

environment:
    TWITTER_API_KEY: "XXXXX"
    TWITTER_API_KEY_SECRET: "XXXXX"
    TWITTER_ACCESS_TOKEN: "XXXXX"
    TWITTER_ACCESS_TOKEN_SECRET: "XXXXX"
    TWITTER_BEARER_TOKEN: "XXXXX"

Finally, start the bot using this command:

docker compose up -d

If you want to stop the bot, use this command:

docker compose down

⁠License

This project is licensed under MIT License. See LICENSE⁠ for more details.

Tag summary

Content type

Image

Digest

sha256:402d0de40…

Size

165.3 MB

Last updated

about 3 years ago

docker pull plck/twitterflightbot