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:
- 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/. 52.9.8.0is one of our EC2 instances on AWS.- 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.