Collects news with news api and stores it in a mysql/mariadb database.
- Initialize a database with the table listed in
init.sql. - Copy config.example.yaml to config.yaml and change it's values..
- Build with
go build ./cmd/news/main.goormake build-all - Run the executable with flag
-c <CONFIG.YAML PATH>in order to scrap the data.
- Install a crontab implementation such as
cronie. make installor make sure you know the path to your exectuable.- Make sure you know the path of your
config.yaml. - Run
crontab -e - Paste this
0 */2 * * * /usr/bin/news-scrap -c /home/daysling/.news.yaml(Change the config file path and you are good to go!)