news_fr / extract_news /README.md
eckendoerffer's picture
Upload 10 files
eaee53a
|
raw
history blame
1.82 kB

NEWS FR

The "NEWS FR" module allows for the extraction of online press articles from over a hundred different sources.

Installation

To set up the module, follow the steps below:

  1. Database Setup:

    • Create a database and incorporate the two tables present in database.sql.
  2. Database Configuration:

    • Update your MySQL connection information in the functions_mysqli.php file.
  3. Dependencies Installation:

    • The script requires the installation of electrolinux/phpquery. Install it using composer:
      composer require electrolinux/phpquery
      

Usage

1. 1_extract_rss.php:

This script fetches RSS feeds from various media outlets and adds URLs for further extraction.

php 1_extract_rss.php

2. 2_extract_news.php:

This script retrieves the sources of articles for subsequent local processing.

php 2_extract_news.php

3. 3_extract_news_txt.php:

This script extracts the text content of press articles and saves it (title + description + text) to a .txt file.

php 3_extract_news_txt.php

After completing this step, you can use the Python script located at /dataset/2_cleaning_txt.py to standardize the text for your dataset.

4. 4_extract_news_url.php:

This script allows for the extraction of links to other articles from local article sources. This ensures swift retrieval of numerous past articles, as opposed to fetching only the most recent ones.

php 4_extract_news_url.php

After using this script, you'll need to run 2_extract_news.php again to retrieve the sources of the new articles, as well as 3_extract_news_txt.php to extract the text from these articles.


PHP + MySQL was chosen for this section to facilitate debugging, and to allow display by source or by media.