Code: Select all
bind pub - !h horoskopi:shqip
package require http
set webi http://top-channel.tv/horoskopi
proc horoskopi:shqip { nick host hand chan text } {
global webi
set shenjaUser [lindex $text 0]
set shenja [string tolower $shenjaUser]
#NQS nuk shkruan shenjen, por ben vetem !h
if {$shenja == ""} {
putserv "NOTICE $nick Komanda eshte shembull: !h dashi"
}
#NQS shkruan vetem shenjat e horoskopit
if {[string match -nocase "dashi" $shenja] || [string match -nocase "demi" $shenja] || [string match -nocase "binjaket" $shenja] ||
[string match -nocase "gaforrja" $shenja] || [string match -nocase "luani" $shenja] || [string match -nocase "virgjeresha" $shenja] ||
[string match -nocase "peshorja" $shenja] || [string match -nocase "akrepi" $shenja] || [string match -nocase "shigjetari" $shenja] ||
[string match -nocase "bricjapi" $shenja] || [string match -nocase "ujori" $shenja] || [string match -nocase "peshqit" $shenja]} {
set c [::http::geturl $webi/[strftime "%d-%m-%Y"]/?shenja=$shenja]
set l [split [::http::data $c] "\n"]
::http::cleanup $c
set c 0
foreach x $l {
incr c
switch $c {
283 {
putnow "PRIVMSG #opers :$nick \002$shenja\002: [html $x]"
}
}
}
#NQS nuk shkruan shenjat e mesiperme, jepet ky errori
} else {
putserv "NOTICE $nick Komanda eshte shembull: !h dashi"
}
}
proc html { text } {
regsub -all "<p>" $text "" text
regsub -all "</p>" $text "" text
return $text
}