Structure

Inside estate.leohamel.com, there’s a Google Sheet file that automatically refreshes every 5 minutes to obtain the latest data on prices of Gold, Silver & Platinum. Here’s how it works:

  1. On that sheet, there’s an App Script named macros.gs. This script is responsible for changing the values of the cells that are used to store prices for Gold, Silver & Platinum by making a request to http://52.9.8.0:5494/.
  2. 52.9.8.0 is one of our EC2 instances on AWS.
  3. On that EC2 instance, the script that is responsible for scraping the prices (from Kitco) is located at /home/bryan/liveprices/liveprices.js. This script runs as a background process through pm2.