Note
The original ticker.sh has been discontinued. This fork aims to help keep similar functionality alive.
ticker.sh
is a Bash script that retrieves and displays live stock prices, along with precious metal prices (gold, silver, platinum) and the gold-to-silver ratio. It uses Yahoo Finance as the source for fetching data and can display results in color-coded output for better readability.
- Fetch live stock prices by providing stock symbols (e.g., AAPL, MSFT, GOOG).
- Display live spot prices for gold, silver, and platinum.
- Calculate and display the Gold/Silver ratio.
- Color-coded output for price changes and metal prices.
- Option to disable colorization by setting the
NO_COLOR
environment variable.
Ensure the following dependencies are installed:
-
Clone the repository or download the
ticker.sh
script. -
Ensure the script is executable:
chmod +x ticker.sh
-
Install the required dependencies:
sudo apt-get install jq bc curl # For Debian-based systems
You can fetch live stock prices by passing the stock symbols as arguments. For example, to retrieve the prices for Apple (AAPL), Microsoft (MSFT), and Google (GOOG), use the following command:
./ticker.sh AAPL MSFT GOOG BTC-USD
This will display the current price, the price change, and the percentage change.
To fetch the spot prices for gold, silver, platinum, and the gold-to-silver ratio, use the -g
flag:
./ticker.sh -g
You can also fetch both stock prices and precious metal prices in a single command:
./ticker.sh -g AAPL MSFT GOOG BTC-USD
This will display both the spot prices for the metals and the prices for the given stock symbols.
If you are running the script in an environment that doesn't support color or if you prefer plain text output, you can disable colorization by setting the NO_COLOR
environment variable:
NO_COLOR=1 ./ticker.sh AAPL MSFT GOOG BTC-USD
Note
Use a foreloop for continious 5 minute
monitoring:
while true; do ./ticker.sh -g SPY GOLD HNST MSFT PFE PLG PYPL RXT WEAT; sleep 300; clear; done
This script is provided as-is under the MIT License
. You are free to modify and distribute it under the terms of the license.
Contributions are welcome! If you encounter bugs or have feature suggestions, feel free to submit an issue or pull request.
Created by @pstadler
Updated by @appatalks