Search code examples
phpmysqlcron

PHP scraping - auto-update


I want to display some charts based on the data I am scraping from a website, I want to know if there is any way to auto-update the data every time the site does. Thanks


Solution

  • To update your Database, you can use CRON to run the script, which scrapes the Web, prepares the variables, and inserts them into your DB.

    Once inserted, your website upon refresh will pull the new data from the DB and show the chart with the updated info.

    You can search for Cron examples to add your script to run periodically.