Last active
December 10, 2015 10:38
-
-
Save mattjj/4421916 to your computer and use it in GitHub Desktop.
get TIPS prices
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 | |
curl -s "http://online.wsj.com/mdc/public/page/2_3020-tips-${1}.html?mod=mdc_pastcalendar" \ | |
| tr '^M' '\n' \ | |
| grep -E '<td class="(([pn]?num)|(text))">' \ | |
| sed -E 's/<[^>]*>([^<]*)<.*/\1/' \ | |
| awk '(NR%6==0){print p; p=""; next}{p=p "\t" $0;}' \ | |
| sed "s/^/${1}/" |
Author
mattjj
commented
Dec 31, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment