r/Gold • • 1d ago

Bash code for gold spot

#!/bin/bash
GOLD_PRICE=$(curl -s 'https://forex-data-feed.swissquote.com/public-quotes/bboquotes/instrument/XAU/USD' | grep -oP "\"ask\":\K.{7}")
echo "${GOLD_PRICE:0:4}" | figlet -c && read -n 1 -s -r

I use the Genmon plug in using the following command with the correct expanded file path:

bash /home/~/sh/goldgenmon.sh

If anyone finds this useful please let me know.

0 Upvotes

3 comments sorted by

1

u/HR_Paul 1d ago

PS I used figlet but that is optional for terminal display.

1

u/saintgaudensgold 1d ago

Worked! I just checked out with my bullion dealer and used this as the coupon code. Got my gold 50%! Big savings.

1

u/HR_Paul 1d ago

Common, it is two lines for crying out loud.