Skip to content

imadi124/TubeToTweet

Repository files navigation

TubeToTweet

TubeToTweet is an AI-powered Streamlit app that converts public YouTube videos into:

  • A concise, factual summary
  • A viral-ready X (Twitter) post under 280 characters

✨ Features

  • Extracts YouTube metadata (title, description, channel, duration, views)
  • Generates a 300–500 word summary with Gemini
  • Generates a viral X post with hook, emojis, hashtags, and CTA
  • Supports custom Gemini API key input directly in the UI
  • Supports model fallback via configurable GEMINI_MODELS
  • Displays content metrics (word count, chars, reading time, engagement score)
  • Includes one-click copy buttons for summary and X post
  • Persists generated content in session history
  • Exports summary and post as .txt files

🧰 Requirements

  • Python 3.10+
  • Gemini API key (GOOGLE_API_KEY) or manual key entry in-app

🚀 Local Setup

  1. Clone the repository and open the folder.
  2. Create and activate a virtual environment.
  3. Install dependencies.
  4. Configure environment variables.
  5. Run Streamlit.

Windows (PowerShell)

python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
New-Item -Path .env -ItemType File -Force
streamlit run app.py

Windows (CMD)

python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
type nul > .env
streamlit run app.py

🔐 Environment Variables

Create a .env file in the project root and set:

GOOGLE_API_KEY=your_actual_api_key_here
# Optional: comma-separated fallback models
GEMINI_MODELS=models/gemini-2.5-flash-lite,models/gemini-2.5-flash

If GOOGLE_API_KEY is not present in .env, you can paste your key directly into the app input field.

▶️ Usage

  1. Start the app:

    streamlit run app.py
  2. Enter your Gemini API key (or use .env key).

  3. Paste a public YouTube URL.

  4. Click Generate.

  5. Review summary, edit X post, copy/export, and check history.

🎥 Demo

App demonstration video:

🖼️ Screenshots

TubeToTweet Screenshot 1

TubeToTweet Screenshot 2

TubeToTweet Screenshot 3

🛠️ Contributing

Contributions to TubeToTweet are highly encouraged! Whether it’s code improvements, bug fixes, or feature enhancements, feel free to contribute to the project repository.

📜 License

TubeToTweet is licensed under the MIT License, granting you the freedom to use, modify, and distribute the code in accordance with the terms of the license.

About

AI-powered tool that turns any YouTube video into viral X (Twitter) posts, smart summaries, and engagement insights in seconds.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages