- PHP 7.2
- PHP Curl Extension.
- PHP PDO + MySQL Extension.
- MySQL Database.
- GNU/Linux Environment.
- Clone the repository
git clone https://github.com/ammarfaizi2/newsScraper
cd newsScraper
cp -vf config/main.php.example config/main.php
cp -vf config/scraper.php.example config/scraper.php
- Create a new MySQL database and import
database.sql
. - Edit config files and adjust the configuration with your environment.
- Run
bin/run.php
. - The scrapers will running on the background process.
- You can check the background process by
ps
command.
ps aux | grep scraper.php
- Change the working directory to
public
folder
cd public
- Run PHP Server by this command
nohup php -S 0.0.0.0:4444 >> /dev/null 2>&1 &
- Open the API endpoint from your browser, for example http://127.0.0.1:4444/index.php