Skip to content

ZendaInnocent/news-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tanzania News API

News API consisting various sources from Tanzania.

Fork the project

Clone the project

git clone https://github.com/<username>/news-api.git

cd news-api

Setup to run scraper locally

Create virtual environment

py -m venv .venv

Activate virtual environment

  • Windows
.venv/scripts/activate
  • Bash
source .venv/bin/activate

Install required packages

Make sure you are in the right directory.

  • cd scraper
pip install -r requirements.txt

Setup a MongoDB and provide a connection string

# .env

MONGO_DETAILS=mongodb://127.0.0.1:12707

Scrawl a particular website

Sites with spiders available for now.

To scrape

scrapy crawl <spider-name>

Spider names

  • ITV - itv
  • Dar24 - dar24
  • MillardAyo - millardayo

Setup to run API locally

Install the required packages

cd api
pip install -r requirements.txt

Run API

python main.py

The project will be available at http://127.0.0.1

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published