Git Product home page Git Product logo

bbc-scraper's Introduction

BBC Scraper

This repository contains a scraper built with Python and integrated with GitHub Actions to fetch RSS feeds from BBC multiple times a day. The scraper utilizes the power of GitHub Actions to automate the scraping process.

Features

  • Fetches 16 public RSS feeds from BBC. (feeds/rss.csv)
  • Runs the scraper 6 times a day to keep the news articles up to date.
  • Utilizes GitHub Actions for automation and scheduling.
  • Saves scraped data to a MongoAtlas cluster. Additionally, saves polarity/sentiment of each article fetched as well.

Project Structure

The basic project structure is as follows:

root\
  ├─ .github\
  │  └─ workflows\
  │     └─ actions.yml
  ├─ .gitignore
  ├─ feeds\
  │  └─ rss.csv
  ├─ resources\
  │  └─ nltk_data\
  │     └─ sentiment\
  │        ├─ vader_lexicon.xml
  │        └─ vader_lexicon.zip
  ├─ src\
  │  ├─ getcontent.py
  │  ├─ getsentiment.py
  │  ├─ loader.py
  │  ├─ mongoconnect.py
  │  └─ scraper.py
  ├─ main.py
  ├─ requirements.txt
  ├─ README.md
  └─ LICENSE

Prerequisites

To run the BBC Scraper locally, you need to have the following prerequisites installed:

  • Python 3.9/3.10
  • pip (Python package installer)
  • MongoDB (Local install)

Getting Started

To get started with the BBC Scraper, follow these steps:

  1. Clone this repository to your local machine using the following command:
    $ git clone [email protected]:sarbhanub/bbc-scraper.git
  2. Navigate to the project directory:
    $ cd bbc-scraper
  3. Install the required Python dependencies:
    $ pip install -r requirements.txt
  4. Run the scraper locally:
    $ python main.py

This will fetch articles present in the RSS feeds from BBC and will save it to MongoDB if you're running it locally on port 27017 (default).

GitHub Actions

The scraper is integrated with GitHub Actions, allowing you to automate the scraping process and schedule it to run multiple times a day and save it directly to a MongoAtlas cluster running on cloud. The workflow file can be found in the .github/workflows directory.

The default configuration is set to run the scraper every 3 hours (8 times a day). You can modify the schedule by editing the .github/workflows/actions.yml file.

License

This project is licensed under the MIT License. You are free to use, modify, and distribute the code as per the terms of the license.

Disclaimer

Please note that scraping websites may be subject to legal restrictions or terms of service. Make sure to review and comply with any applicable terms and conditions when using this scraper. BBC Scraper is provided as-is and the developers are not responsible for any misuse or legal consequences resulting from its use.

bbc-scraper's People

Contributors

sarbhanub avatar dependabot[bot] avatar

Watchers

 avatar

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.