Skip to content

FrancoCanzani/f1-radios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Team Radio to Twitter Bot

This project fetches the latest Formula 1 team radio recordings, converts the audio to text using Google's Speech Recognition API, and posts the transcribed message to Twitter.

Features

  • Fetches the latest team radio data from the OpenF1 API.
  • Downloads the latest team radio recording.
  • Converts the audio from MP3 to WAV format.
  • Uses Google's Speech Recognition API to transcribe the audio.
  • Posts the transcribed message to Twitter with driver and team information.

Requirements

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/team-radio-to-twitter.git
    cd team-radio-to-twitter
  2. Create and activate a virtual environment (optional but recommended):

    python -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Set up environment variables: Create a .env file in the root of the project and add your Twitter API credentials:

    CONSUMER_KEY=your_consumer_key
    CONSUMER_SECRET=your_consumer_secret
    ACCESS_TOKEN=your_access_token
    ACCESS_TOKEN_SECRET=your_access_token_secret
    

Usage

  1. Run the script:
    python main.py

Project Structure

  • main.py: Contains the main logic for fetching, processing, and posting the team radio data.
  • helpers/twitter.py: Contains the helper function post_tweet for posting tweets using Tweepy.
  • audio_files/: Directory where audio files are temporarily stored.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages