Created
August 6, 2014 16:14
-
-
Save hagope/76ac6955ec5f450ea036 to your computer and use it in GitHub Desktop.
Realtime Stock Quote from Google Finance using cURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Author
hagope
commented
Mar 27, 2015
Doesn't work as per 2018-05-20.
@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
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