File: linuxtrade.wn

package info (click to toggle)
linuxtrade 3.65-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,100 kB
  • ctags: 1,978
  • sloc: ansic: 30,168; sh: 4,922; perl: 566; makefile: 126
file content (50 lines) | stat: -rwxr-xr-x 1,544 bytes parent folder | download | duplicates (2)
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/&nbsp;//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>&nbsp;Ticker<BR>Symbol<BR></TD>
<TD ALIGN=CENTER COLSPAN=2 VALIGN=BOTTOM><B>&nbsp;Quarter&nbsp;Ending&nbsp;<BR>Sep 02<BR><HR WIDTH=50% SIZE=1></TD>
<TD ALIGN=CENTER COLSPAN=3 VALIGN=BOTTOM><B>&nbsp;Previous&nbsp;Quarter&nbsp;<BR><HR WIDTH=50% SIZE=1></TD></TR>
<TR BGCOLOR=#C0C0C0>
<TD ALIGN=CENTER><B>&nbsp;Consensus&nbsp;<BR>Estimate<BR></TD>
<TD ALIGN=CENTER><B>&nbsp;Whisper&nbsp;<BR>Number<BR></TD>
<TD ALIGN=CENTER><B>&nbsp;Consensus&nbsp;<BR>Estimate<BR></TD>
<TD ALIGN=CENTER><B>&nbsp;Whisper&nbsp;<BR>Number<BR></TD>
<TD ALIGN=CENTER><B>&nbsp;Reported&nbsp;<BR>Earning<BR></TD>
</TR>
<TR BGCOLOR=#FFFFFF><TD ALIGN=CENTER>&nbsp;<BIG><A href=http://www.getwhispers.com/gw/template.cgi?file=quote&ticker=INTC>INTC</A><BR></TD>
<TD ALIGN=CENTER>&nbsp;<BIG>0.13<BR></TD>
<TD ALIGN=CENTER BGCOLOR=#F0C0E0>&nbsp;<BIG><B>0.13<BR></TD>
<TD ALIGN=CENTER>&nbsp;0.11<BR></TD>
<TD ALIGN=CENTER>&nbsp;0.11<BR></TD>
<TD ALIGN=CENTER>&nbsp;0.09<BR></TD>
</TR></TABLE>