Skip to content

Instantly share code, notes, and snippets.

@hagope hagope/stock.sh
Created Aug 6, 2014

Embed
What would you like to do?
Realtime Stock Quote from Google Finance using cURL
#!/bin/bash
# Usage: stock.sh TWTR 30
# Say TWTR current price every 30 seconds
while true
do
curl -s https://www.google.com/finance?q=$1 | grep ref_ -m 1 | sed 's|<[^>]*>||g' | say
sleep $2
done
@hagope

This comment has been minimized.

Copy link
Owner Author

hagope commented Mar 27, 2015

wget -q -O - http://www.google.com/finance?q=AAPL | grep ref_ -m 1 | sed 's|<[^>]*>||g'
@paul-dest

This comment has been minimized.

Copy link

paul-dest commented May 20, 2018

Doesn't work as per 2018-05-20.

@shussain

This comment has been minimized.

Copy link

shussain commented May 28, 2018

@paul-dest Add a user-agent.

E.g: curl -A "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" -s https://www.google.com/finance?q=$1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.