Hello to all Tcl Gurus,
I got the Tcl script from this post http://forum.egghelp.org/viewtopic.php?t=19009
While trying to run the script i get this error message...
"Tcl error [curl:image]: couldn't open "/home/amo/public_html/images/dupe.db"
what is "dupes.db" and how to fix this error?
As mentioned in script Curl is required, i have already installed the Curl on my shell, do i need to configure it as well ? I am zero in Curl.
Hope you guys will help me out.
many thanks.
Code: Select all
# 16/06/2012
# by doggo #omgwtfnzbs @ EFNET
# curl_image.tcl
#
# curl is required on the shell to use this script
# available @ http://curl.haxx.se/
#########################################################
bind pubm -|- {*://*.jpg*} curl:image
bind pubm -|- {*://*.jpe*} curl:image
bind pubm -|- {*://*.jpeg*} curl:image
bind pubm -|- {*://*.gif*} curl:image
bind pubm -|- {*://*.png*} curl:image
bind pubm -|- {*://*.bmp*} curl:image
set save_folder "/home/amo/public_html/images"
set dupe_links "/home/amo/public_html/images/dupe.db"
set your_site "http://your.website.url"
proc curl:image {nick userhost handle channel str} {
global save_folder dupe_links your_site
set urlcheck(ext) {
jpg
jpe
jpeg
gif
png
bmp
}
if {![regexp {((?:http://|www\.)+[^ ]+)} $str str]} { return }
set extension ""
set wlink $str
if { [string match -nocase "*$your_site*" "$wlink"] == 1 } { return }
regsub -all -- {(http://)+} $str "" str
regexp {(www.)?[A-z|0-9|\-|\.|\_]*\.[A-z]{2,3}} $str host
regexp {[/]+(.)*} $str url
regexp {[A-z]{3,4}$} $str extension
set ispic 0
foreach i $urlcheck(ext) {
if {[string match -nocase $extension $i]} {
set ispic 1
}
}
if {$ispic != 1} { return }
set file_name [md5 $wlink]
set file [open $dupe_links r]
set data [read $file]
close $file
set isdupe 0
foreach line [split $data \n] {
if { [string match -nocase "*$file_name*" "$line"] == 1 } {
catch {unset data}
set isdupe 1
}
}
if {$isdupe == 1} { return }
catch {exec curl $wlink -o $save_folder/$file_name.$extension}
if {![file exists $save_folder/$file_name.$extension]} {
return
} else {
set fp [open $dupe_links "a"]
puts $fp $file_name.$extension
close $fp
}
}
putlog "curl_image.tcl loaded"