File: linuxtrade.sq

package info (click to toggle)
linuxtrade 3.65-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,880 kB
  • ctags: 1,969
  • sloc: ansic: 30,091; sh: 2,278; perl: 566; makefile: 126
file content (44 lines) | stat: -rwxr-xr-x 658 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
#!/bin/bash

#
#	Helper script for the swissquote.ch aggragated quote server
#

read USER
read PW
read HOSTNAME
read PORT

SITE="http://$HOSTNAME:$PORT"

case "$HOSTNAME" in
private*|premium*)	TIMEOUT=12;;
*)			TIMEOUT=15;;
esac

URL="$SITE/fcgi-bin/parser?parser=2&symbols="
UA="Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"

#
# Read the first set of symbols from linuxtrade
#
read SYMS

#
# Loop, checking for new symbol requests and getting new quote
#
while :
do
	newsyms=
	read -t $TIMEOUT newsyms
	if [ "$newsyms" != "" ]; then
		SYMS="$newsyms"
	fi

	curl -A "$UA" -s "$URL$SYMS" 2>/dev/null

	if [ "$?" != 0 ]; then
		rm -f $TMP
		exit 1
	fi
done