Hi and thanks for that....
I'll try and place that in my code, might be back if it dont work
Edit: It didnt work
This is the code i have (edited from another tcl i found, author unknown)
Code: Select all
proc pub:file { nick uhost handle channel arg } {
global agent
if {[llength $arg]==0} {
putserv "PRIVMSG $channel :FFS! Use The Correct Syntax! !file FILENAME"
} else {
set searchphrase "searchphrase"
set query "http://www.WEBSITE.com/search/query/p/?q=${searchphrase}&Category=-1&searchFP=p"
set query "$query[lindex $arg 0]"
# putserv "PRIVMSG $channel :$query"
set token [http::config -useragent $agent]
set token [http::geturl $query]
set html [http::data $token]
puts stderr ""
upvar #0 $token state
set max 0
# foreach {name value} $state(meta) {
# putserv "PRIVMSG $channel :$value"
# }
# putserv "PRIVMSG $channel :$html"
set result "[lindex $html 1]"
set result [string range $result [expr [string first = $result]+2] [expr [string first > $result]-2]]
putserv "PRIVMSG $channel :$result"
}
}
When i type, !File Dredd in the channel to test, i get the following error:
[12:59] Tcl error [pub:file]: list element in quotes followed by ">" instead of space