I've tried another one, with the url that you gave me...
### Configuration settings ###
# the triggers: [seperate with spaces]
set google(triggers) "!legendas"
# flags needed to use the trigger [default=everyone]
set google(flags) "-|-"
# channels where the bot doesn't respond to triggers [seperate with spaces]
set google(nopub) ""
# flood protection: seconds between use of the triggers
# to disable: set it to 0
set google(antiflood) 5
# method to send the messages:
# 0 = Private message
# 1 = Public message
# 2 = Private notice
# 3 = Public notice
set google(method) 1
# show how many results? 1, 2 or 3??
set google(results) 3
# show every result on a new line? 0=no 1=yes
set google(perline) 0
set google(version) 0.4
if {[catch { package require http } err]} {
putlog "Cannot load [file tail [info script]]: Problem loading the http package: $err"
return 1
}
if {[info tclversion] < 8.1} {
putlog "Cannot load [file tail [info script]]: You need at least Tcl version 8.1 and you have Tcl version [info tclversion]."
return 1
}
foreach trigger [split $google(triggers)] {
bind pub $google(flags) $trigger google:pub
}
catch { unset trigger }
proc google:output {chan nick output} {
global google
switch $google(method) {
0 { putquick "PRIVMSG $nick :$output" }
1 { putquick "PRIVMSG $chan :$output" }
2 { putquick "NOTICE $nick :$output" }
3 { putquick "NOTICE $chan :$output" }
default { putquick "PRIVMSG $chan :$output" }
}
}
proc google:pub {nick uhost hand chan text} {
global lastbind google
if {[lsearch -exact $google(nopub) [string tolower $chan]] >= 0} { return 0 }
if {[string length [string trim [lindex $text 0]]] == 0} {
putquick "NOTICE $nick :Usage: $lastbind <keywords>"
return 0
}
if {[info exists google(floodprot)]} {
set diff [expr [clock seconds] - $google(floodprot)]
if {$diff < $google(antiflood)} {
putquick "NOTICE $nick :Trigger has just been used! Please wait [expr $google(antiflood) - $diff] seconds..."
return 0
}
catch { unset diff }
}
set google(floodprot) [clock seconds]
regsub -all { } [join $text] {+} search
set google(url) "
http://www.legendasxvid.net/modules.php ... erby=dateD"
set google(page) [http::config -useragent "Mozilla"]
if {[catch {set google(page) [http::geturl $google(url) -timeout 15000]} msg]} {
putquick "NOTICE $nick :Can't connect ($msg)"
return 0
}
set google(data) [http::data $google(page)]
if {$google(results) >= 1} {
regexp -nocase {related:(.*?)>} $google(data) t link1
}
if {$google(results) >= 2} {
regexp -nocase {related:.*?>.*?related:(.*?)>} $google(data) t link2
}
if {$google(results) >= 3} {
regexp -nocase {related:.*?>.*?related:.*?>.*?related:(.*?)>} $google(data) t link3
}
if {$google(perline) == 1} {
set separator "\n"
} else {
set separator "-"
}
if {[info exists link3]} {
set output "http://$link1 $separator http://$link2 $separator http://$link3"
} elseif {[info exists link2]} {
set output "http://$link1 $separator http://$link2"
} elseif {[info exists link1]} {
set output "http://$link1"
} else {
set output "Nothing found." <------------------------------------
}
regsub -all {%26} $output {\&} output
regsub -all {%3F} $output {?} output
regsub -all {%3D} $output {=} output
if {$google(perline) == 1} {
foreach line [split $output \n] {
google:output $chan $nick [string trim $line]
}
} else {
google:output $chan $nick [string trim $output]
}
catch { unset output separator t link1 link2 link3 }
catch { http::cleanup $google(page) }
return 0
}
putlog "Google script $google(version) loaded!"
On the irc, it shows: Nothing found.
even if i change that part, i have no ideia what to put there.