I decided that I wanted to ingest some weather data through a different means, this time combining Google API scripts to retrieve the data from the API and another script to connect to the MySQL Database and deposit the data. Both steps are setup on a schedule.
Setting up the API Call:
I followed the instructions from the following medium post to create a function in Google Apps Scripts that would call an API for me. I use it to call the weather API website and retrieve the weather data for where I live.
These 2 things combined import the data into my Google Sheet as per:
Getting the data into MySQL:
So now that I have the data in Google Sheets I want to regularly import this data into a database as it only stores a single row in google sheet, though I could probably get it to persist here as well. Looking at my options with the JDBC drivers available MySQL could work and Snowflake couldn't easily and I didn't really want to use a Keboola Flow several times a day to track this.
I found the following post and modified the code as needed for my weather data and MySQL credentials. I then set that to run on a schedule as well so the data would get imported into the MySQL database on a regular basis and I can look to integrate it with my parkrun and step data to look for correlations between times / number of steps and the weather.
MySQL Table Script:
Comments
Post a Comment