16/08/2009, 23:41
Voici donc la nouvelle version.
Si vous avez des idées à nouveau, n'hésitez pas à m'en faire part.
tcl
#############
## GNU/GPL ##
######################################
# see www.gnu.org/licenses/agpl.txt #
######################################
set ::cmd "!search"
set ::imgcmd "!images"
set ::vidcmd "!videos"
set ::lastcmd "!lastsearch"
set ::helpcmd "!helpsearch"
set ::author "BlackNight"
set ::scriptver "1.1"
set ::vidbase "http://video.google.fr/videosearch?q="
set ::googlebase "http://www.google.fr/search?hl=fr&q="
set ::imgbase "http://images.google.fr/images?hl=fr&q="
set ::chan {
"#accueil"
"#les-tenebres"
"#la_tour_des_anges"
}
bind pub - $::cmd google_search
bind pub - $::lastcmd google_lastsearch
bind pub - $::imgcmd google_imgsearch
bind pub - $::vidcmd google_vidsearch
bind pub - $::helpcmd google_help
proc google_search {nick host hand chan arg} {
foreach google $::chan {
if [string match -nocase $google $chan] {
set ::search [join [lrange $arg 0 end] +]
set ::url "http://www.google.fr/search?hl=fr&q=$::search"
set ::unick $nick
putquick "PRIVMSG $chan :\002\00307$::unick \00312votre recherche se trouve sur\00303 $::url \002\003"
}
}
}
proc google_imgsearch {nick host hand chan arg} {
foreach google $::chan {
if [string match -nocase $google $chan] {
set ::search [join [lrange $arg 0 end] +]
set base $::imgbase
set ::url "$base$::search"
set ::unick $nick
putquick "PRIVMSG $chan :\002\00307$::unick \00312votre recherche se trouve sur\00303 $::url \002\003"
}
}
}
proc google_vidsearch {nick host hand chan arg} {
foreach google $::chan {
if [string match -nocase $google $chan] {
set ::search [join [lrange $arg 0 end] +]
set base $::vidbase
set ::url "$base$::search"
set ::unick $nick
putquick "PRIVMSG $chan :\002\00307$::unick \00312votre recherche se trouve sur\00303 $::url \002\003"
}
}
}
proc google_lastsearch {nick host hand chan arg} {
foreach google $::chan {
if [string match -nocase $google $chan] {
putquick "PRIVMSG $chan :\002\00312La dernière recherche effectuée par\00312\00307 $::unick\00307 \00312est\00312 \00303$::url\00303\002"
}
}
}
proc google_help {nick host hand chan arg} {
foreach google $::chan {
if [string match -nocase $google $chan] {
putfast "NOTICE $nick :\00312Pour faire une recherche sur google \00313-> \00303$::cmd \00307<votre recherche>\003"
putfast "NOTICE $nick :\00312Pour faire une recherche d'image sur google \00313-> \00303$::imgcmd \00307<votre recherche>\003"
putfast "NOTICE $nick :\00312Pour faire une recherche de vidéo sur google \00313-> \00303$::vidcmd \00307<votre recherche>"
putfast "NOTICE $nick :\00312Cette fonctionalité vous est proposée par \002BlackNight\002"
}
}
}
putlog "GoogleSearch $::scriptver par $::author chargé avec succès"
Si vous avez des idées à nouveau, n'hésitez pas à m'en faire part.