It gets news from Tuko, Capital FM, The Standard, Daily Nation and The Star, then returns top news from each and a short summary of each article.
There is a cli version and a flask web api version.
Python 3 (3.6.1 used in the project)
pip install requests beautifulsoup4 A step by step series of examples that tell you have to get a development env running in unix systems
-
Clone the repo
-
Setting up a virtual environment, Python 3 virtual env docs
python3 -m venv /path/to/new/virtual/environment
- Activate the Virtual env
source /path/to/new/virtual/environment/bin/activate
-
cd to the cloned directory.(The one with requirements.txt)
-
Install the requirements from requirements.txt
pip install -r requirements.txt
Run the cli version
python scheduler_script.py get_news_cli
First scrape the news sources to create and fill up the database before running the flask version
python scheduler_script.py scrape_news
then...
Run app.py to start web server (you can check end points at app.py)
python app.py
Note: you can run python scheduler_script.py delete_old_news
to delete news more that 48 hours old
- Python HTTP Requests - HTTP for Humans
- Beautiful Soup 4 - html parser
- Me ¯\_(ツ)_/¯
This project is licensed under the Apache License 2.0 - see the LICENSE file for details