Skip to content

It scrapes various kenyan news sites and returns top news from each and a summary of each news item

License

Notifications You must be signed in to change notification settings

alfiepoleon/kenya-news-scrapper

Repository files navigation

Kenya News Scrapper

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.

Screenshots

alt text alt text alt text

Prerequisites

Python 3 (3.6.1 used in the project)

Installing

pip install requests beautifulsoup4 A step by step series of examples that tell you have to get a development env running in unix systems

  1. Clone the repo

  2. Setting up a virtual environment, Python 3 virtual env docs

python3 -m venv /path/to/new/virtual/environment
  1. Activate the Virtual env
source /path/to/new/virtual/environment/bin/activate
  1. cd to the cloned directory.(The one with requirements.txt)

  2. Install the requirements from requirements.txt

pip install -r requirements.txt

There are two ways to run this script

Run the cli version

python scheduler_script.py get_news_cli

OR

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

Built With

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

About

It scrapes various kenyan news sites and returns top news from each and a summary of each news item

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages