Simple CLI to check if a website is up or down.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
-
You will require Python 3.5+ to run this project. If you are using a different version of Python, you will need to update your Python version to 3.5+ to run this project. You can check your Python version by running
python --version
in your terminal. There are ways to install different versions of Python on your system and this can be done using pyenv -
Poetry is a Python package manager that is used to manage dependencies. You can check the installation instructions in the link provided to get this setup.
Start by installing dependencies using poetry install
.
poetry install
This will setup a virtualenv and install all the dependencies.
Once you have all the installed dependencies, you can start running the CLI.
As a first step run python -m siteup -h
command to view the sub commands available:
> python -m siteup -h
usage: siteup [-h] [-u URLs [URLs ...]] [-f FILE] [-a]
check the availability of websites
optional arguments:
-h, --help show this help message and exit
-u URLs [URLs ...], --urls URLs [URLs ...]
enter one or more website URLs
-f FILE, --input-file FILE
read URLs from a file
-a, --asynchronous run the connectivity check asynchronously
Checking for the availability of a website:
> python -m siteup -u google.com
The status of "google.com" is: "Online!" 👍
Or checking for a list of sites
> python -m siteup -u google.com -u yahoo.com -u bing.com
The status of "google.com" is: "Online!" 👍
The status of "yahoo.com" is: "Online!" 👍
The status of "bing.com" is: "Online!" 👍
Or check these asynchronously passing in the -a
flag.
> python -m siteup -u google.com -u yahoo.com -u bing.com -a
The status of "google.com" is: "Online!" 👍
The status of "yahoo.com" is: "Online!" 👍
The status of "bing.com" is: "Online!" 👍
python3 -m siteup -u google.com bing.com yahoo.com unknown-site.org -a
The status of "unknown-site.org" is: "Offline?" 👎
Error: "Cannot connect to host unknown-site.org:443 ssl:default [Name or service not known]"
The status of "bing.com" is: "Online!" 👍
The status of "google.com" is: "Online!" 👍
The status of "yahoo.com" is: "Online!" 👍
Or you can pass in a file to check a list of sites
google.com
facebook.com
twitter.com
youtube.com
wikipedia.org
yahoo.com
linkedin.com
contents of site.txt
➜ python3 -m siteup -f sites.txt -a
The status of "youtube.com" is: "Online!" 👍
The status of "facebook.com" is: "Online!" 👍
The status of "wikipedia.org" is: "Online!" 👍
The status of "google.com" is: "Online!" 👍
The status of "twitter.com" is: "Online!" 👍
The status of "yahoo.com" is: "Online!" 👍
The status of "linkedin.com" is: "Online!" 👍
Please read the contributing guide to learn how to contribute to this project.
Semantic versioning is used to track the version of the project.