This application scrapes the website surf-forecast from Vilas do Atlântico, which can be easily replaced on the code by your wished location, just change the URL from surf-forecast in the /src/forecast.py
file.
Original project was being developed under my tools
repository. But since it could be used by others i thought it would be nicer to have a separate repo for it.
This was done using Python3.5, the main dependencies are:
pandas
, lxml
, BeautifulSoup
, python-telegram-bot
and requests
. Clone the repository to your computer and run this command to install them all:
$ pip3 install -r requirements.txt
In order to run the application, just access the src
folder and:
$ python3 telegramInterface.py
Instead of having a server to run our script, one possible solution is to use anacron
to run our Python script periodically. I decided to run it once a day. If you want to do it yourself, create an executable shell script but without the .sh
extension, otherwise cron won't run your script, there's an example located on this repository (without underline, dashes etc, otherwise cron won't run it as well) called runforecaster.sh
.
- Make sure to remove the
.sh
extension from the file - If you wish to run it daily, then
$ sudo cp runforecaster /etc/cron.daily
- To debug and check if it's running properly:
$ sudo run-parts /etc/cron.daily
if anything goes wrong it will output on the same terminal. - To check the log from anacron
$ grep anacron /var/log/syslog
- To check when anacron will run your daily scripts
$ grep run-parts /etc/crontab
- Add tide high and low times column
- Analisys from the energy and wind and create a condition column
- Try to get data from windguru and send both graphs
- Send report to e-mail
- Henrique Poleselo - hpoleselo