1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/bash
#
# Get earnings whisper number
#
if [ $# != 0 ]; then
sym=$1
else
sym=intc
fi
SYM=`echo "$sym" | tr '[a-z]' '[A-Z]'`
URL="http://www.getwhispers.com/gw/template.cgi?file=whispers&ticker=$SYM"
# lynx -width=9999999 -dump $URL
getdata() {
curl -s "$URL" | tee /tmp/zzz | sed \
-e '1,/BIG.*template/d' \
-e '/TABLE/,/^$/d' \
-e 's/<[^>]*>//g' \
-e 's/ //g'
}
declare -a vals
vals=(`getdata`)
echo "$SYM: Estimated: ${vals[0]}, Whisper: ${vals[1]}"
exit
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>
<TR BGCOLOR=#C0C0C0><TD ROWSPAN=2 ALIGN=CENTER><B> Ticker<BR>Symbol<BR></TD>
<TD ALIGN=CENTER COLSPAN=2 VALIGN=BOTTOM><B> Quarter Ending <BR>Sep 02<BR><HR WIDTH=50% SIZE=1></TD>
<TD ALIGN=CENTER COLSPAN=3 VALIGN=BOTTOM><B> Previous Quarter <BR><HR WIDTH=50% SIZE=1></TD></TR>
<TR BGCOLOR=#C0C0C0>
<TD ALIGN=CENTER><B> Consensus <BR>Estimate<BR></TD>
<TD ALIGN=CENTER><B> Whisper <BR>Number<BR></TD>
<TD ALIGN=CENTER><B> Consensus <BR>Estimate<BR></TD>
<TD ALIGN=CENTER><B> Whisper <BR>Number<BR></TD>
<TD ALIGN=CENTER><B> Reported <BR>Earning<BR></TD>
</TR>
<TR BGCOLOR=#FFFFFF><TD ALIGN=CENTER> <BIG><A href=http://www.getwhispers.com/gw/template.cgi?file=quote&ticker=INTC>INTC</A><BR></TD>
<TD ALIGN=CENTER> <BIG>0.13<BR></TD>
<TD ALIGN=CENTER BGCOLOR=#F0C0E0> <BIG><B>0.13<BR></TD>
<TD ALIGN=CENTER> 0.11<BR></TD>
<TD ALIGN=CENTER> 0.11<BR></TD>
<TD ALIGN=CENTER> 0.09<BR></TD>
</TR></TABLE>
|