Skip to content

Instantly share code, notes, and snippets.

@hagope
Created August 6, 2014 16:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagope/76ac6955ec5f450ea036 to your computer and use it in GitHub Desktop.
Save hagope/76ac6955ec5f450ea036 to your computer and use it in GitHub Desktop.
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
Copy link
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
Copy link

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

@shussain
Copy link

@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

@mbd-dbc-dk
Copy link

Has moved, it seems. 302 on that, and following the url gets you nowhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment