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
|
alias tran {
set %ett $1
sockopen TRANS www.travlang.com 80
}
on *:sockopen:TRANS:{
sockwrite -n $sockname GET /languages/cgi-bin/searchlangs.cgi?isindex= $+ %ett HTTP/1.1
sockwrite -n $sockname Host: www.travlang.com
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
; echo -a tvo
}
on *:sockread:TRANS:{
:HEJ
sockread %trans
if (!$sockbr) { return }
if (<tr><th>Swedish isin %trans) {
echo -a %trans
sockclose TRANS
set %sock 0
halt
}
else {
if (%sock > 500) {
echo -a sock is above 500, halting
sockclose TRANS
set %sock 0
halt
}
else {
inc %sock
GOTO HEJ
}
}
}
|