Optimized: v6 Dynamic Dashboard Builder 1️⃣ User-Interactive

ChatGPT Prompts
0 upvotes

You are an expert software engineer specializing in full-stack web application development with Python (Flask) and dynamic content generation. Your task is to create a fully functional proof-of-concept for a dynamic video dashboard builder, as described below. The target environment is a Windows system, and the final deliverable is a single, self-contained Batch file that orchestrates the entire process. This project is designed for ChatGPT, so prioritize clarity and modularity in your code generation to facilitate iterative refinement. **Goal:** Generate a single Batch file that, when executed, sets up a virtual environment, installs dependencies, launches a Flask server with a user-interactive setup UI, dynamically scrapes video feed data, generates an HTML dashboard, and opens the dashboard in a web browser. The dashboard should auto-refresh and offer a user-friendly experience. **Context:** The dashboard will display live video feeds from the Rumble 24/7 category (https://rumble.com/category/24x7). The setup UI, presented as a modal-driven webpage served by Flask, allows the user to customize the dashboard's appearance (light/dark theme), the number of video cells (default: 4), and optional titles/overrides for each video. The scraped data (thumbnail, title, description, view count, video embed ID) will be stored in a JSON file (rumble_ids.json), serving as a dynamic playlist. The Batch file should handle virtual environment creation, dependency installation (Flask, Selenium/Playwright, etc.), Flask server execution, HTML dashboard generation, and browser launch. The Flask server is responsible for scraping, JSON updates, and dashboard rendering. **Output Structure:** The Batch file should be structured with clear sections for: 1. **Virtual Environment Setup:** Create a virtual environment and install necessary Python packages (specify common packages needed for web scraping, json handling and Flask). 2. **Flask Server Setup:** Define the Flask application with routes for the setup UI and dashboard. Use modular Python code within the Batch file to handle data scraping, JSON manipulation, and HTML generation. 3. **HTML Dashboard Generation:** Dynamically generate the HTML dashboard based on the JSON playlist and user preferences. Use placeholders for video cells, thumbnails, titles, and viewer counts. 4. **UI Implementation:** Create the modal-driven setup UI with options for theme selection, video count adjustment, and title overrides. 5. **Web Scraping Logic:** Implement web scraping using Selenium or Playwright to extract video information from the Rumble 24/7 category. Handle potential errors gracefully. 6. **JSON Management:** Implement logic to read from and write to the rumble_ids.json file. 7. **Auto-Refresh Logic:** Include meta tags in the HTML to refresh the dashboard every minute. 8. **Browser Launch:** Automatically open the generated dashboard in the default web browser. **Constraints and Rules:** * The entire solution must be contained within a single Batch file. Use techniques like embedding Python code within the Batch file to achieve this. * Prioritize code readability and maintainability. * Handle errors gracefully (e.g., if the scraping fails or the JSON file is corrupted). * Use a clean and modern HTML/CSS layout for the dashboard. * Adhere to best practices for web scraping (e.g., respect robots.txt, handle rate limiting). * The default number of video cells should be 4, but the user must be able to increase this value. * The dashboard should support both light and dark themes. * The user interface should be intuitive and easy to use. * Minimize external dependencies beyond the core requirements of Flask and Selenium/Playwright. * Dashboard styling can be basic but functional. Focus on dynamic data population rather than extensive CSS. **Placeholders:** * [Rumble Category URL] (currently: https://rumble.com/category/24x7) * [Default Number of Video Cells] (currently: 4) * [JSON Filename] (currently: rumble_ids.json) Consider using ChatGPT's ability to generate efficient and well-documented code when creating the Batch file and the embedded Python scripts. Break down the task into smaller, manageable functions to enhance code clarity. Aim for a working proof-of-concept that demonstrates the core functionality of the dynamic video dashboard builder.

Try this Prompt