A simple Python project to monitor whether a website is online or offline. It periodically sends HTTP requests to the target website and logs the results. All the program will run in terminal chat.
- Check if a website is online (HTTP 200 OK).
- Detect connection errors and timeouts.
- Continuous monitoring with a configurable interval.
- Logging to both console and file (
monitor.log). - Unit tests with
pytest.
get_checker/
│
├── get_checker/ # source code
│ ├── __init__.py
│ ├── checker.py # website checking logic
│ └── logger.py # logging setup
│
├── tests/ # pytest tests
│ └── test_checker.py
│
├── .gitignore
├── requirements.txt # dependencies
├── CHANGELOG.md
├── CONTRIBUTING.md
├── README.md # project documentation
└── main.py # main entry point
git clone https://github.com/yourusername/get-checker.git
cd get-checkerpython -m venv venv
source venv/bin/activate # on Linux/Mac
venv\Scripts\activate # on Windowspip install -r requirements.txtpython main.pyOpen the get_checker.log to see all logs.
- Python 3.x (recommended: 3.11 or 3.12)
- Requests (To sends HTTP requests)
- pytest (for running tests).
1. Install pytest (installing requirements or this step):
pip install pytest2. Run the tests:
pytestPytest will automatically discover tests inside the tests/ directory and run them.
This project is licensed under the MIT License.
See the LICENSE file for details.
Lucas Alcântara
GitHub: @A1cantar4