This is my first build.
Allows viewing the latest contest and the relative numbers of the famous Italian lottery: SuperEnalotto
on *:text:!superenalotto:#: {
set %supercanale $chan
sockclose super
sockopen super www.lottomatici.com 80
}
on *:sockopen:super: {
if ($sockerr) {
echo -s Errore connessione al Sito.
sockclose super
}
else {
sockwrite -n $sockname GET $+(/lotto/) HTTP/1.1
sockwrite -n $sockname Host: www.lottomatici.com
sockwrite -n $sockname $crlf
}
}
on *:sockread:super: {
var %super.temp
sockread %super.temp
if (<h3>Estrazione Superenalotto del* iswm %super.temp) { msg %supercanale 2,15 $remove($htmlfree(%super.temp), n°) }
If (<h3>Concorso n* iswm %super.temp) { msg %supercanale 2,15 $htmlfree(%super.temp) }
If (*Jolly :* iswm %super.temp) { msg %supercanale 2,15 Combinazione Vincente: $remove($htmlfree(%super.temp), –) }
If (<td class="numerosuperstar"> iswm %super.temp) { msg %supercanale 2,15 Numero SuperStar: $htmlfree(%super.temp) }
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, n°)
return %x
}