rona is a simple alias
that runs a Python script I made to get data from my city hall official website about the COVID-19 pandemic. It'll work as long as the html structure of the website isn't changed.
These instructions will get you a copy of the project up, but keep in mind that they were written assuming that you are on a Unix system.
-
Download the
rona.py
and.bash_aliases
files (available in this repository) and place them in theDownloads
folder of your computer; -
Make sure you have
python3
and thebeautifulsoup4
,requests
andlxml
packages installed on your system.
Create a directory called rona
in your home
directory. You can achieve this by opening your terminal and typing:
$ cd ~/
$ mkdir rona
Then, copy the rona.py
file into the newly created directory (rona
):
$ cp ~/Downloads/rona.py ~/rona/
To make sure all went ok, enter the following commands:
$ cd ~/rona/
$ ls
You should see as output the rona.py
file you copied earlier.
rona.py
Now the next step is to create an alias
to easily run our rona.py
script in the terminal. To do so, copy the .bash_aliases
file to your home directory. You can do this by typing:
$ cp ~/Downloads/.bash_aliases ~/
Hooray! Now all that's left to do is to make sure everything is working properly. To do this, open your terminal and type rona
. After a few seconds, you should see something like this as the output:
You can also get the same result by running only the rona.py
file, typing:
$ cd ~/rona/
$ python3 rona.py