Code Monkey home page Code Monkey logo

daily-news-scraper's Introduction

Daily-news-scraper

Ths is a simple web scraper utilizing newspaper3k to scrape news articles and send them via text. Currently, it scrapes 2 sources: Business Daily and Standard media

The Script then sends top 3 headlines with links to the specified mobile_number in the `.env

Prerequisites

This project also uses an .env file to store the API key, username and mobile number Both can be obtained by signing up/logging into Africas Talking An env example is provided for reference.

Step 1

Clone this repo to a suitable location.

git clone https://github.com/KenMwaura1/daily-news-scraper

OR

Download the zip and extract it.

Step 2

Change into the directory.

cd daily-news-scraper

Step 3

Create a virtual environment (venv) to hold all of the required dependecies.Here we use the built-in venv module.

python -m venv env

Activate the virtual environment

source env/bin/activate

Alternatively if you are using pyenv

pyenv virtualenv daily-news-scraper
pyenv activate daily-news-scraper

Step 4

Install the required dependencies:

pip install -r requirements

Step 5

Create .env file and add your credentials as specified.

touch .env

OR

Copy the provided example and edit as required:

cp .env-example env

Step 6

Run the script

python news_scraper.py

daily-news-scraper's People

Contributors

dependabot[bot] avatar kenmwaura1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hartl3y94

daily-news-scraper's Issues

Can I get the video url in the article?

Hi Mate,

As the title says, in some articles, there are videos contained, is there any way I can automatically find the videos in the articles?
Some are videos from X, some are from youtube and especially some videos have been saved on their CDN server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.