🔔 Çevrimdışı bildirim almak ister misiniz?
Bir konuya etiketlendiğinizde, özel mesaj aldığınızda, bir mesajınız alıntılandığında forumda olmasanız bile anlık bildirim almak için lütfen izni verin.
Merhaba, bu tcl script ile google üzerinden dosya, müzik vs araması yaptırabilirsiniz sunucunuzda.
Kod: Kodu kopyalamak için üzerine çift tıklayın!
#######################################################################
#######################################################################
# Google by CeSAR #
# v1.0 #
# #
# Gets search results from Google.com. Nothing fancy yet, just gets #
# however many returns you want. Idea is based on a script by #
# aNa|0Gue, although the code is all new. #
# #
# Latest version @ Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir. Comments & Questions to murf@[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]less.com #
#######################################################################
# Only tested on TCL v8.3 and Egg v1.6x, although I kept the code #
# generic enough for TCL v8.0 and probably v1.3 of egg. #
#######################################################################
# #
# Commands #
# #
# .google keyword(s) <# of results> #
# #
# e.g. .google murf 5 #
# #
# Version #
# v1.0 Aug 16 2002 #
# -- first version #
# #
# Contact murf@[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]less.com for bugs/comments #
# This and other scripts available @ [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] #
#######################################################################
#######################################################################
## default number of returns
set google_def_num 10
## max number of returns
set google_max 10
## public bind
set glpubbind ara
set gl_output "PRIVMSG $nick"
##########binds######################
bind pub -|- $glpubbind pub_google
##########Procs######################
proc pub_google {nick uhost handle chan search} {
global gl_ouput
set gl_output "PRIVMSG $nick"
if {[llength $search] == 0} {
puthelp "$gl_output : Ne aricagini soylemeyi unutmadin mi acaba!?"
return 0
}
set url [google_url $search $nick $chan]
google_getpage $url
return 0
}
## Google_url #############################################
## Takes input and parses to set the url, returns the url
proc google_url {search nick chan} {
global google_def_num google_max gl_output
set google_num [lindex $search end]
if {[regexp { [0-9]+} $search match $google_num]} {
if {$google_num > $google_max} { set google_num $google_max }
set search [lrange $search 0 [expr {[llength $search] - 2}]]
} else {
set google_num $google_def_num
}
if {$google_num >= 5} {
set gl_output "PRIVMSG $nick"
} else {
set gl_output "PRIVMSG $chan"
}
regsub -all { } $search {+} search
set url "/search?hl=en&num=$google_num&lr=&ie=ISO-8859-1&q=$search"
return $url
}
## google_getpage ##########################################
## gets the webpage and parses for the returns
proc google_getpage {url} {
global gl_output
## Open socket
if {[catch {set glsock [socket -async [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] 80]} sockerr]} {
puthelp "PRIVMSG $nick :$sockerr"
puthelp "PRIVMSG $nick :Daha sonra dene, bu sirada pencereden disari bakabilirsin!"
close $glsock
return 0
}
puts $glsock "GET $url"
flush $glsock
set i 0
set j 1
set glout [gets $glsock]
while {[regexp {Dissatisfied with your results?} $glout] == 0} {
set glout [gets $glsock]
incr i
if {$i >= 150} {
break
}
if {[regexp {#008000>(.*?) - } $glout match gl_result($j)]} {
puthelp "$gl_output :$j. http://$gl_result($j)"
incr j
}
}
close $glsock
return 0
}
putlog "Google v1.0 by CeSaR loaded"