Skip to content

Leumars-o/alx-productivity-tool

Repository files navigation

ALX Productivity Tool

A comprehensive automation tool designed for ALX Software Engineering students to monitor project deadlines, receive educational content, and stay updated with their intranet activities through Telegram notifications.

🌟 Features

  • Project Monitoring: Automatically scrapes ALX intranet to track active projects, deadlines, and progress
  • Daily Educational Content: Generates and sends programming quizzes, facts, and inspirational quotes
  • Telegram Integration: Delivers all notifications directly to your Telegram chat
  • Automated Scheduling: Runs daily at 6:30 AM (Africa/Lagos timezone) to keep you updated
  • Multi-User Support: Manages multiple ALX student accounts simultaneously
  • Smart Notifications: Different message formats for various project statuses and content types

Getting Started

Prerequisites

  • Python 3.9+
  • Telegram Bot Token
  • Google Generative AI API Key
  • ALX Intranet credentials

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/alx-productivity_tool.git
    cd alx-productivity_tool
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up environment variables

    Create a .env file in the root directory with the following structure:

    USER_EMAIL="[email protected]"
    USER_PASSWORD="your_password"
    TELEGRAM_TOKEN="your_bot_token"
    TELEGRAM_CHAT_ID="your_chat_id"
    GENAI_API_KEY="your_google_ai_api_key"
    
    # Multiple users (format: email_password_chatid)
    ALX_USER_1="[email protected]_password1_chatid1"
    ALX_USER_2="[email protected]_password2_chatid2"
    ALX_USER_3="[email protected]_password3_chatid3"
  4. Run the application

    python scheduler.py

📋 Configuration

Telegram Bot Setup

  1. Create a bot through @BotFather
  2. Get your bot token
  3. Find your chat ID by messaging @userinfobot

Google AI Setup

  1. Visit Google AI Studio
  2. Create an API key for Gemini
  3. Add it to your .env file

🏗️ Architecture

Core Components

  • scheduler.py: Main orchestrator that manages timed execution of all functions
  • intranet_login.py: Web scraper for ALX intranet data extraction
  • genai.py: AI content generator using Google's Gemini model
  • telegram_notify.py: Telegram Bot API integration for message delivery
  • credentials.py: Secure credential management system

Data Flow

Scheduler (6:30 AM) → Intranet Scraper → Project Data → Telegram
                   → AI Generator → Educational Content → Telegram

📊 What You'll Receive

Daily Project Updates

  • 📌 Current active projects with progress percentages
  • 📆 Start dates and deadlines
  • 📊 Monthly performance averages
  • 🔗 Direct links to intranet projects
  • ⚠️ Evaluation quiz notifications

Educational Content (Randomized Daily)

  • 🧠 Programming quizzes (Python, JavaScript, C, Bash)
  • 📖 Interesting programming facts
  • 💡 Inspirational quotes for developers

🔧 Customization

Scheduling

Modify timing in scheduler.py:

trigger_projects = CronTrigger(hour='6', minute='30', second='0', timezone=timezone)
trigger_ai = CronTrigger(hour='6', minute='30', second='3', timezone=timezone)

Content Types

Adjust AI prompts in genai.py:

prompts = [
    f"Generate an interesting quiz question for {languages[random_number]}",
    f"Give me a unique programming fun fact on {languages[random_number]}",
    "Give me an inspirational quote for a programmer"
]

Languages

Modify supported programming languages:

languages = ["python", "javascript", "c", "bash"]

🐳 Docker Support

Build and run with Docker:

docker build -t alx-productivity-tool .
docker run -d --name alx-tool alx-productivity-tool

📁 Project Structure

alx-productivity_tool/
├── scheduler.py          # Main scheduler and orchestrator
├── intranet_login.py     # ALX intranet web scraper
├── genai.py             # AI content generation
├── telegram_notify.py   # Telegram bot integration
├── credentials.py       # Credential management
├── requirements.txt     # Python dependencies
├── .env                # Environment variables
├── Dockerfile          # Container configuration
└── README.md           # Documentation

🔒 Security

  • Credentials stored securely in environment variables
  • Session-based authentication with CSRF protection
  • No hardcoded sensitive information
  • Dockerized deployment option

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • ALX Software Engineering Program
  • Google Generative AI (Gemini)
  • Telegram Bot API
  • Beautiful Soup for web scraping
  • APScheduler for task scheduling

⚠️ Disclaimer

This tool is designed for educational purposes to help ALX students manage their coursework. Please ensure compliance with ALX's terms of service when using automated tools to access their intranet.

About

Automated productivity tool for ALX students - Daily project monitoring, AI-generated programming content, and Telegram notifications.

Resources

Stars

Watchers

Forks

Contributors

Languages