An AI-powered application that generates personalized love poems and sends them to your email. Built with Flask, OpenAI API (via 3d7tech), Gmail, and Twitter integration.
✨ AI-Generated Poems - Create unique, romantic love poems using advanced AI 📧 Email Delivery - Receive your poems as beautifully formatted PDFs via Gmail 🐦 Social Sharing - Share your poems on Twitter/X with one click 🎨 Beautiful Design - Modern, responsive web interface 📱 Mobile Friendly - Works on all devices 🔒 Privacy First - Your data is secure
🌐 GitHub Pages: https://richardawe.github.io/valentine_day_gift/
git clone https://github.com/richardawe/valentine_day_gift.git
cd valentine_day_gift
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
.env file with your credentials:
OPENAI_API_KEY=not-needed
TWITTER_API_KEY=your_twitter_key
TWITTER_API_SECRET=your_twitter_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
GMAIL_USER=your_email@gmail.com
GMAIL_APP_PASSWORD=your_app_password
TEST_EMAIL=your_email@gmail.com
API_BASE_URL=https://api.3d7tech.com/v1
python app.py
http://localhost:5000
.env file.env fileThe app uses the free 3d7tech API for AI poem generation. It’s OpenAI-compatible and runs Ollama models.
Website: https://api.3d7tech.com/
python ai_valentine.py "Your poem prompt here"
This will:
valentine_day_gift/
├── app.py # Flask backend application
├── ai_valentine.py # Original CLI script
├── templates/
│ └── index.html # Web frontend
├── docs/
│ └── index.html # GitHub Pages landing page
├── .env # Environment variables (create this)
├── requirements.txt # Python dependencies
└── README.md # This file
app.py - Flask web application with API endpointsai_valentine.py - Original CLI version with full workflowtemplates/index.html - Web interfacedocs/index.html - GitHub Pages landing page/api/generate-poemGenerate a poem and send via email.
Request:
{
"email": "recipient@example.com",
"prompt": "Your love story or poem idea",
"share_on_twitter": true
}
Response:
{
"success": true,
"message": "Poem generated and sent!",
"poem": "The generated poem text...",
"tweet_url": "https://x.com/status/..."
}
/api/tweetsRetrieve all tweets sent.
Response:
[
{
"timestamp": "2026-01-16T...",
"poem_preview": "Your love story...",
"tweet_id": "...",
"url": "https://x.com/status/..."
}
]
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues or questions, please open an issue on GitHub or contact the maintainers.
Made with ❤️ by the AI Valentine’s Team