@[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] CR'de Bu Şekilde Çalışırmış, Denemedim Ama Kod Bu.. ^^ : )
Kod:
#####
# ¿ #
#####
# Kanal'i belirtin.
set ara(kanal) "#Webmaster"
# Komut on eki.
set ara(komut) ".ara"
##########
# CISS ! #
##########
bind pub – $ara(komut) ara:sira
proc ara:sira {nick uhost hand chan text} {
global botnick ara
if {[string match -nocase $ara(kanal) $chan]} {
set url "[lindex $text 0]"
set keyword "[lrange $text 1 end]"
regsub -all " " $keyword "%20" keyword
if {$url == ""} { putquick "PRIVMSG $chan :Kullanimi: .ara <url> <kelime> seklindedir."; return 0 }
if {$keyword == ""} { putquick "PRIVMSG $chan :Kullanimi: .ara $url <kelime> seklindedir."; return 0 }
set apiweb "http://proje.ircdepo.tk/sirabulucu/api.xml?url=$url&keyword=$keyword"
catch {set sayfa [::http::geturl $apiweb -timeout 5000]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putquick "PRIVMSG $chan :Hata: Suan siteye baglanilamiyor... Daha sonra tekrar deneyiniz..."
::http::cleanup $sayfa
return 0
}
if {[::http::status $sayfa] == "*timeout*"} {
putquick "PRIVMSG $chan :Hata: Baglanti zaman asimina ugradi..."
::http::cleanup $sayfa
return 0
}
set html "[::http::data $sayfa]"
::http::cleanup $sayfa
regexp -nocase {<hata>(.*?)</hata>} $html match hata
regexp -nocase {<sonuc>(.*?)</sonuc>} $html match sonuc
regexp -nocase {<sira>(.*?)</sira>} $html match sira
regexp -nocase {<link>(.*?)</link>} $html match link
if {[info exists hata]} {
putquick "PRIVMSG $chan :4$hata"
}
if {[info exists sonuc]} {
putquick "PRIVMSG $chan :12G4o7o12g3l4e 1siralamaniz asagida yer almaktadir:"
putquick "PRIVMSG $chan :"
putquick "PRIVMSG $chan :10Aranan(lar):"
putquick "PRIVMSG $chan :4Url:2 $url"
regsub -all "%20" $keyword " " keyword
putquick "PRIVMSG $chan :4Kelime:2 $keyword"
putquick "PRIVMSG $chan :"
putquick "PRIVMSG $chan :10Sonuc(lar):"
putquick "PRIVMSG $chan :4Siraniz:2 $sira"
putquick "PRIVMSG $chan :4Link:2 $link"
putquick "PRIVMSG $chan :"
putquick "PRIVMSG $chan :12G4o7o12g3l4e 1sorgulama sonu..."
}
::http::cleanup $html
}
}
#######
# SON #
#######