diff --git a/data.sh b/data.sh new file mode 100755 index 0000000000000000000000000000000000000000..5376f3aa48690efc840fcddc226cb45bb6488e39 --- /dev/null +++ b/data.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +curl https://www.kitco.com/charts/livegold.html > data.html +goldprice=$(cat data.html | grep "sp-bid" | sed 's/[^$.0-9]*//g') + +curl https://www.kitco.com/charts/livesilver.html > data2.html +silverprice=$(cat data2.html | grep "sp-bid" | sed 's/[^$.0-9]*//g') + +curl https://www.kitco.com/charts/livepalladium.html > data3.html +palladiumprice=$(cat data3.html | grep "sp-bid" | sed 's/[^$.0-9]*//g') + +curl https://www.kitco.com/charts/liveplatinum.html > data4.html +platinumprice=$(cat data4.html | grep "sp-bid" | sed 's/[^$.0-9]*//g') + +date=$(date +%d-%m-%Y) +time=$(date "+%H-%M %p") + +echo "GoldPrice:$goldprice, SilverPrice:$silverprice, PalladiumPrice:$palladiumprice, PlatinumPrice:$platinumprice, DateTime: $date $time" >>data.txt