From 4d0e340916ebf8e87aa933176cbd33d5e6ffa7c2 Mon Sep 17 00:00:00 2001 From: Steven B <4163156+appatalks@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:34:23 -0500 Subject: [PATCH 1/2] Create yahoo_finance_api_delivery.sh --- delivery/yahoo_finance_api_delivery.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 delivery/yahoo_finance_api_delivery.sh diff --git a/delivery/yahoo_finance_api_delivery.sh b/delivery/yahoo_finance_api_delivery.sh new file mode 100644 index 0000000..5750a97 --- /dev/null +++ b/delivery/yahoo_finance_api_delivery.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +API_DELIVER_ENDPOINT="https://localhost:5000/api/deliver" + +fetch_data_from_api_gateway() { + curl -k -s -X GET "$API_DELIVER_ENDPOINT" -H "Content-Type: application/json" +} + +results=$(fetch_data_from_api_gateway) +data=$(echo "$results" | jq -r '.data') +decoded_data=$(echo "$data") +url=$(echo "$decoded_data" | jq -r '.headers.url') +response=$(curl -s "$url") + +# Print response from Yahoo Finance API +echo "$response" From 46c522990e7c1ef385fbca5a71774248705b006b Mon Sep 17 00:00:00 2001 From: Steven B <4163156+appatalks@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:35:05 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69e8be4..47c4ade 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ A simple FIFO API Gateway for managing API calls, storing them in MySQL, and pro - Save Yahoo Finance API Call ```bash - curl -X POST http://localhost:8000/api/save -H "Content-Type: application/json" -d '{"data": "{\"headers\": {\"Accept\": + curl -k -X POST https://localhost:5000/api/save -H "Content-Type: application/json" -d '{"data": "{\"headers\": {\"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8\", \"url\": \"https://query1.finance.yahoo.com/v8/finance/chart/AAPL?interval=1d\"}}"}' {"status":"success"}