Skip to content
Snippets Groups Projects
Commit dcb3b708 authored by qxt1u23's avatar qxt1u23
Browse files

(Commit Message) Automatically plot graph

parent 11012cc9
No related branches found
No related tags found
No related merge requests found
time price_usd time price_usd
2024-12-09 17:18:41 50000.01 2024-12-10 15:00:06 2670.39
2024-12-09 18:07:29 50000.01 2024-12-10 15:20:03 2668.89
2024-12-09 18:09:13 2656.99 2024-12-10 15:48:53 2667.84
2024-12-09 18:17:59 2656.46 2024-12-10 15:50:05 2666.89
2024-12-09 18:18:06 2656.46 2024-12-10 15:53:06 2665.94
2024-12-09 18:18:11 2656.61 2024-12-10 15:55:04 2665.11
2024-12-09 18:18:15 2656.61 2024-12-10 15:57:03 2665.13
2024-12-09 18:21:00 2657.86 2024-12-10 15:58:05 2665.13
2024-12-09 21:12:39 2656.52 2024-12-10 15:59:06 2664.98
2024-12-09 21:16:11 2655.97 2024-12-10 16:01:04 2664.22
2024-12-09 21:41:48 50000.01 2024-12-10 16:02:05 2664.38
2024-12-09 22:04:20 50000.01 2024-12-10 16:03:05 2664.75
2024-12-09 22:18:24 100.00 2024-12-10 16:04:06 2664.68
2024-12-09 22:20:01 100.00 2024-12-10 16:05:03 2664.47
2024-12-09 22:21:01 100.00 2024-12-10 16:06:05 2664.53
2024-12-09 22:22:01 100.00 2024-12-10 16:07:06 2663.84
2024-12-09 22:23:01 100.00 2024-12-10 16:08:05 2664.40
2024-12-09 22:24:01 100.00 2024-12-10 16:09:06 2664.23
2024-12-09 22:25:01 100.00 2024-12-10 16:10:04 2664.62
2024-12-09 22:26:01 100.00 2024-12-10 16:11:05 2664.84
2024-12-09 22:27:01 100.00 2024-12-10 16:12:04 2664.87
2024-12-09 22:28:01 100.00 2024-12-10 16:12:28 2664.91
2024-12-09 22:29:02 100.00 2024-12-10 16:13:06 2664.91
2024-12-09 22:30:01 100.00 2024-12-10 16:14:06 2664.91
2024-12-09 22:31:01 100.00 2024-12-10 16:15:06 2663.39
2024-12-09 22:32:01 100.00 2024-12-10 16:16:03 2663.68
2024-12-09 22:33:01 100.00 2024-12-10 16:17:05 2663.18
2024-12-09 22:34:01 100.00 2024-12-10 16:18:06 2663.35
2024-12-09 22:35:01 100.00 2024-12-10 16:18:31 2663.26
2024-12-09 22:36:01 100.00 2024-12-10 16:19:05 2662.98
2024-12-09 22:37:01 100.00 2024-12-10 16:20:04 2662.82
2024-12-09 22:38:02 100.00 2024-12-10 16:21:06 2662.82
2024-12-09 22:39:01 100.00 2024-12-10 16:22:05 2662.93
2024-12-09 22:40:01 100.00 2024-12-10 16:23:05 2662.85
2024-12-09 22:41:01 100.00 2024-12-10 16:24:03 2662.83
2024-12-09 22:42:01 100.00 2024-12-10 16:25:06 2662.64
2024-12-09 22:43:01 100.00 2024-12-10 16:26:05 2662.64
2024-12-09 22:44:01 100.00 2024-12-10 16:27:04 2662.15
2024-12-09 22:45:01 100.00 2024-12-10 16:28:05 2662.03
2024-12-09 22:46:01 100.00 2024-12-10 16:29:04 2661.96
2024-12-09 22:47:01 100.00 2024-12-10 16:30:04 2662.07
2024-12-09 22:48:01 100.00 2024-12-10 16:31:05 2661.89
2024-12-09 22:49:01 100.00 2024-12-10 16:32:05 2662.34
2024-12-09 22:50:01 100.00 2024-12-10 16:33:06 2662.34
2024-12-09 22:51:01 100.00 2024-12-10 16:34:04 2662.43
2024-12-09 22:52:01 100.00 2024-12-10 16:39:03 2663.64
2024-12-09 22:53:01 100.00 2024-12-10 16:40:03 2663.93
2024-12-09 22:54:02 100.00 2024-12-10 16:41:06 2664.41
2024-12-09 22:55:01 100.00 2024-12-10 16:42:07 2664.95
2024-12-09 22:56:01 100.00 2024-12-10 21:26:04 2674.91
2024-12-09 22:57:02 100.00 2024-12-10 21:27:03 2674.95
2024-12-09 22:58:02 NULL 2024-12-10 21:28:07 2675.01
2024-12-09 22:59:02 NULL 2024-12-10 21:29:06 2675.07
2024-12-09 23:00:02 NULL 2024-12-10 21:30:04 2675.04
2024-12-09 23:01:02 NULL 2024-12-10 21:31:07 2674.57
2024-12-09 23:01:02 2674.19 2024-12-10 21:32:06 2674.54
2024-12-09 23:02:01 NULL 2024-12-10 21:33:04 2674.64
2024-12-09 23:02:02 2674.31 2024-12-10 21:34:06 2673.66
2024-12-09 23:03:01 NULL 2024-12-10 21:35:07 2673.99
2024-12-09 23:03:01 2674.35 2024-12-10 21:36:07 2673.76
2024-12-09 23:04:01 NULL 2024-12-10 21:37:04 2673.88
2024-12-09 23:04:02 2674.09 2024-12-10 21:38:07 2673.99
2024-12-09 23:05:01 NULL 2024-12-10 21:39:06 2674.07
2024-12-09 23:05:01 2672.70 2024-12-10 21:40:04 2674.21
2024-12-09 23:06:01 NULL 2024-12-10 21:41:07 2674.89
2024-12-09 23:06:01 2672.70 2024-12-10 21:42:07 2675.88
2024-12-09 23:07:02 2672.76 2024-12-10 21:43:07 2676.44
2024-12-09 23:08:01 2672.76 2024-12-10 21:44:04 2676.27
2024-12-09 23:14:02 2673.65 2024-12-10 21:45:05 2676.26
2024-12-09 23:15:01 2673.85 2024-12-10 21:46:05 2676.97
2024-12-09 23:16:01 2674.37 2024-12-10 21:47:06 2676.28
2024-12-09 23:17:02 2676.11 2024-12-10 21:48:04 2676.40
2024-12-09 23:18:01 2674.74 2024-12-10 21:49:07 2676.76
2024-12-09 23:19:01 2675.27 2024-12-10 22:01:07 2680.20
2024-12-09 23:20:02 2675.27 2024-12-10 22:02:07 2679.56
2024-12-09 23:21:01 2675.48 2024-12-10 22:03:04 2680.64
2024-12-09 23:22:01 2674.93 2024-12-10 22:04:07 2681.34
2024-12-09 23:23:01 2674.82
2024-12-09 23:24:02 2674.74
2024-12-09 23:25:01 2674.88
2024-12-09 23:26:01 2674.80
2024-12-09 23:27:02 2674.47
2024-12-09 23:28:01 2674.39
2024-12-09 23:29:01 2674.24
2024-12-10 10:09:04 2670.04
2024-12-10 10:10:04 2670.04
2024-12-10 10:11:04 2669.95
2024-12-10 10:12:03 2669.78
2024-12-10 10:13:04 2669.88
2024-12-10 10:14:04 2668.82
2024-12-10 10:15:04 2669.07
2024-12-10 10:16:02 2669.30
2024-12-10 10:17:04 2668.93
2024-12-10 10:18:04 2668.68
2024-12-10 10:19:05 2668.83
2024-12-10 11:00:04 2669.49
2024-12-10 11:24:05 2666.96
2024-12-10 11:25:04 2667.71
2024-12-10 11:26:05 2668.03
2024-12-10 11:27:05 2667.63
2024-12-10 11:28:03 2667.93
2024-12-10 11:29:06 2667.44
2024-12-10 11:29:37 2667.44
2024-12-10 11:30:04 2667.44
2024-12-10 11:31:05 2666.78
2024-12-10 11:33:03 2666.87
2024-12-10 11:33:05 2666.87
2024-12-10 11:34:05 2667.39
2024-12-10 11:35:05 2667.38
2024-12-10 11:36:03 2668.20
2024-12-10 11:37:06 2668.37
2024-12-10 11:38:05 2668.57
2024-12-10 11:39:05 2669.20
2024-12-10 11:40:03 2669.00
2024-12-10 11:41:05 2669.43
2024-12-10 11:42:06 2669.46
2024-12-10 11:43:06 2669.44
2024-12-10 11:44:06 2669.64
2024-12-10 11:45:03 2669.93
2024-12-10 11:46:05 2669.88
2024-12-10 11:47:05 2670.16
2024-12-10 11:48:05 2670.31
2024-12-10 11:49:04 2670.31
2024-12-10 11:50:05 2670.51
2024-12-10 11:51:05 2671.39
2024-12-10 11:52:04 2671.32
2024-12-10 11:53:05 2671.07
2024-12-10 11:54:05 2671.03
2024-12-10 11:55:03 2671.11
2024-12-10 11:56:04 2670.99
2024-12-10 11:57:04 2669.32
2024-12-10 14:07:03 2668.35
2024-12-10 14:08:04 2667.47
2024-12-10 14:09:06 2667.47
2024-12-10 14:10:05 2667.56
2024-12-10 14:11:04 2667.02
2024-12-10 14:12:05 2666.79
2024-12-10 14:13:05 2667.03
2024-12-10 14:14:06 2667.04
2024-12-10 14:15:03 2667.03
2024-12-10 14:16:06 2666.81
2024-12-10 14:17:05 2666.81
2024-12-10 14:18:05 2667.12
2024-12-10 14:19:04 2667.90
2024-12-10 14:20:05 2668.14
2024-12-10 14:21:05 2668.14
2024-12-10 14:22:05 2667.68
2024-12-10 14:23:04 2667.68
2024-12-10 14:24:05 2667.74
2024-12-10 14:25:06 2668.48
2024-12-10 14:26:05 2668.76
2024-12-10 14:27:03 2668.75
2024-12-10 14:28:06 2668.93
2024-12-10 14:29:06 2668.89
2024-12-10 14:30:06 2668.81
2024-12-10 14:31:04 2669.19
2024-12-10 14:32:06 2669.03
2024-12-10 14:33:03 2669.38
2024-12-10 14:34:05 2669.32
2024-12-10 14:35:06 2669.26
2024-12-10 14:36:05 2668.87
2024-12-10 14:37:03 2668.95
2024-12-10 14:38:05 2668.58
2024-12-10 14:39:05 2668.46
set terminal png size 1200,800 # Wider output set terminal png size 1200,800 # Wider output
set margin 10,10,13,5 set margin 10,10,13,5
set output "plot.png" set output "/home/qxt1u23/comp1314/plot.png"
set title "Gold Price Over Time" set title "Gold Price Over Time"
set xlabel "Time (Date Time)" offset 0, -9 set xlabel "Time (Date Time)" offset 0, -9
set ylabel "Gold Price (USD in oz)" set ylabel "Gold Price (USD in oz)"
...@@ -10,4 +10,4 @@ set format x "%Y-%m-%d %H:%M:%S" ...@@ -10,4 +10,4 @@ set format x "%Y-%m-%d %H:%M:%S"
set grid set grid
set xtics rotate by 70 set xtics rotate by 70
set xtics offset -5, -9.5 set xtics offset -5, -9.5
plot "export_sql_data.txt" using 1:2 with linespoints title "Gold Price" plot "/home/qxt1u23/comp1314/export_sql_data.txt" using 1:3 with linespoints title "Gold Price"
...@@ -341,3 +341,83 @@ obtainUSDGold.sh executed at Tue Dec 10 14:36:05 +08 2024 ...@@ -341,3 +341,83 @@ obtainUSDGold.sh executed at Tue Dec 10 14:36:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:37:03 +08 2024 obtainUSDGold.sh executed at Tue Dec 10 14:37:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:38:05 +08 2024 obtainUSDGold.sh executed at Tue Dec 10 14:38:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:39:05 +08 2024 obtainUSDGold.sh executed at Tue Dec 10 14:39:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:40:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:41:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 14:42:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:00:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:20:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:48:53 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:50:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:53:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:55:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:57:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:58:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 15:59:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:01:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:02:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:03:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:04:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:05:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:06:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:07:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:08:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:09:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:10:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:11:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:12:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:12:28 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:13:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:14:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:15:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:16:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:17:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:18:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:18:31 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:19:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:20:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:21:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:22:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:23:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:24:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:25:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:26:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:27:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:28:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:29:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:30:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:31:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:32:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:33:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:34:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:39:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:40:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:41:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 16:42:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:26:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:27:03 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:28:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:29:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:30:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:31:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:32:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:33:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:34:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:35:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:36:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:37:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:38:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:39:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:40:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:41:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:42:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:43:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:44:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:45:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:46:05 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:47:06 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:48:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 21:49:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 22:01:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 22:02:07 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 22:03:04 +08 2024
obtainUSDGold.sh executed at Tue Dec 10 22:04:07 +08 2024
...@@ -33,3 +33,5 @@ echo "obtainUSDGold.sh executed at $(date)" >> /home/qxt1u23/comp1314/logfile.lo ...@@ -33,3 +33,5 @@ echo "obtainUSDGold.sh executed at $(date)" >> /home/qxt1u23/comp1314/logfile.lo
mysql -u root gold_database -e "SET @price=$price; source /home/qxt1u23/comp1314/tosql.sql;" mysql -u root gold_database -e "SET @price=$price; source /home/qxt1u23/comp1314/tosql.sql;"
mysql -u root gold_database -e "SELECT * FROM gold_price;" > /home/qxt1u23/comp1314/export_sql_data.txt mysql -u root gold_database -e "SELECT * FROM gold_price;" > /home/qxt1u23/comp1314/export_sql_data.txt
/usr/bin/gnuplot /home/qxt1u23/comp1314/graph_plotting.gp
#!/bin/bash
curl -Is https://goldprice.org > /dev/null 2>&1 # throw that thing into the abyss. 2 means STDERR 1 means STDOUT. writes 2 into 1. Basically useless . Throw into AByss nothing happened here
# curl -I fetches the HTTP headers. Returns non-zero if failed.
if [ $? -ne 0 ]; then #checks what ping returns. If ping returns something that is not 0, connection fails. If it is zero, connection successful.
echo "Network Connection Failed" # Cited from: https://stackoverflow.com/questions/18123211/checking-host-availability-by-using-ping-in-bash-scripts
exit 1
fi
response=$(curl -s -w "%{http_code}" -o /tmp/output.html https://goldprice.org)
if [ "$response" -ne 200 ]; then
echo "Permission Denied ---- HTTP Status: $response"
exit 1
fi
price=$(curl -s "https://data-asg.goldprice.org/dbXRates/USD" | jq -r '.items[0].xagPrice')
if [ -z "$price" ]; then
echo "Failed Accessing Price"
exit 1
fi
echo "$price"
mkdir -p ./logs
echo "obtainUSDGold.sh executed at $(date)" >> ./logs/logfile.log
plot.png

40.4 KiB | W: | H:

plot.png

47.6 KiB | W: | H:

plot.png
plot.png
plot.png
plot.png
  • 2-up
  • Swipe
  • Onion skin
#!/bin/bash
./obtain_silverUSDPrice.sh | ./silver_toKg.sh
#!/bin/bash
read number
convert=$(echo "$number / 0.0311035" | bc -l)
echo "$convert"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment