Back to prompts
Code15.11.2026
Write a Python Script That Monitors Your Site Uptime and Response Time During Black Friday Weekend
#python#uptime monitoring#black friday#ecommerce#website performance#script#small business
You are a careful developer who helps small online stores stay online during their busiest weekend. Black Friday and Cyber Monday bring traffic spikes, and I want a small, readable Python script that checks my most important pages every few minutes, records how fast they respond, and warns me when something breaks or slows down. The script only sends normal GET requests to pages I own. It must never log in, submit forms, add items to a cart, place orders, or hit any site I do not control. If something about my setup is unclear, mark it [NEEDS INPUT] instead of guessing. Pages I want to watch (home, top category, best selling product, cart, checkout start page, status or health URL): [URLS] How often to check and for how many days: [SCHEDULE] What counts as slow for me, in seconds: [SLOW THRESHOLD] How I want to be alerted (printed warning, local log file, email through my own SMTP, or a webhook I already have): [ALERTS] Where it will run (my laptop, a small server, a scheduled job) and the Python version: [ENVIRONMENT] Whether I can install one package such as requests: [PACKAGES] Requirements: 1. Before writing code, list what this script can and cannot tell me. It sees my site from one location, so it is not a replacement for my host's monitoring or my payment provider's status page. 2. Write the script with a clear config block at the top for [URLS], [SCHEDULE], [SLOW THRESHOLD], and [ALERTS]. Use a short timeout, a polite user agent that names my store, and a delay between requests so I never load my own site. 3. For each check, record the time, URL, status code, response time, and whether the page contains one expected phrase I set per URL, so a blank error page with status 200 is still caught. 4. Write results to a CSV file I can open in a spreadsheet, and print a one line summary per round. 5. Alert only when something changes: a page goes down, comes back, or stays slower than [SLOW THRESHOLD] for 3 checks in a row. Do not send an alert every minute. 6. If [ALERTS] uses email or a webhook, read any secret from an environment variable, never from the code, and show me how to test the alert once before the weekend. 7. Add a small report function that reads the CSV and shows uptime percentage, average and slowest response time per URL, and the longest outage. 8. Explain how to run it, how to stop it safely, and how to schedule it on [ENVIRONMENT] in plain steps. 9. Add a short checklist of things to do when an alert fires: check my host status page, check my payment provider status page, and who to contact. Deliverables: 1. What this script can and cannot tell you 2. The full Python script with config block 3. Example CSV rows and console output 4. Alert test steps 5. Run, stop, and schedule instructions 6. When an alert fires checklist
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.
Tip
Fill every placeholder before you run the prompt. Keep one clear goal per run, then refine with a follow-up if needed.
When to use this prompt
- •Good for first drafts in Code
- •Keep variables filled so the model has enough context
- •Review AI output before sending or publishing