| View previous topic :: View next topic |
| Author |
Message |
smolder Voice
Joined: 06 Jul 2015 Posts: 11
|
Posted: Tue Jul 07, 2015 11:11 am Post subject: Tcl Error |
|
|
[Edit] (Just realized i have posted my topic on wrong forum, it should be on "Tcl FAQ" i think, i am sorry.)
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: | # 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"
|
|
|
| Back to top |
|
 |
Arnold_X-P Master

Joined: 30 Oct 2006 Posts: 221 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Mon Jul 13, 2015 7:30 pm Post subject: Re: Tcl Error |
|
|
the error is:
set save_folder "/home/amo/public_html/images"
set dupe_links "/home/amo/public_html/images/dupe.db"
change amo for user access example
set dupe_links "/home/my logging/public_html/images/dupe.db" _________________
thanks to that they help, that others learn  |
|
| Back to top |
|
 |
smolder Voice
Joined: 06 Jul 2015 Posts: 11
|
Posted: Tue Jul 14, 2015 12:37 pm Post subject: Re: Tcl Error |
|
|
Arnold_x-p: thank you for your reply.
"amo" is my username on shell account. The issue is... there's no such file named "dupe.db" in any directory, it's kind of database file But i have no idea how to create/generate this file.  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Jul 15, 2015 1:55 am Post subject: |
|
|
in shell
| Code: |
touch /home/amo/public_html/images/dupe.db
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
smolder Voice
Joined: 06 Jul 2015 Posts: 11
|
Posted: Fri Jul 17, 2015 5:05 pm Post subject: |
|
|
| caesar wrote: | in shell
| Code: |
touch /home/amo/public_html/images/dupe.db
|
|
Thank you for you help Caesar. Dupe.db has been created but still this script is not working for me.
I think i should find alternative.
Thank you once again for all you help guys.
Regards. |
|
| Back to top |
|
 |
|