#########################################
# Urlgrab.tcl by KuNgFo0 (www.eggfaq.com)
#VERSION 0.4
#DESCRIPTION Logs urls seen in channels and privmsg to a file.
# Set the next line as the file to log to
set urlgrab_file "scripts/url/url.data"
# Set the next line as the phrases to look for
# (wildcards may be used)
set urlgrab_keys {
*http://*
}
proc filtmirc {arg} {
regsub -all {\003\d{0,2}(,\d{0,2})?} $arg {} arg
regsub -all {\002|\003|\026|\037} $arg {} arg
return $arg
}
proc parseurl {url} {
foreach var {protocol user pass server port path cgiargs anchor} { upvar 1 $var $var }
if {[regexp {(?i)(http://\S+)} $url a b protocol c user pass server d port e path f cgiargs g anchor]} {
if {$protocol == ""} { set protocol "http" }
# if {![validnum $port]} { set port 80 }
return 1
} else { return 0 }
}
proc pubm_urlgrab {nick uhost hand chan arg} {
msgm_urlgrab $nick $uhost $hand $arg
}
proc ctcp_urlgrab {nick uhost hand dest keyword arg} {
msgm_urlgrab $nick $uhost $hand $arg
}
proc msgm_urlgrab {nick uhost hand arg} {
global urlgrab_file urlgrab_keys
set urls ""
foreach word [filtmirc $arg] {
if {[parseurl $word]} { lappend urls $word }
}
if {$urls != ""} {
if {[catch {open $urlgrab_file a} fileid]} { putlog "Error: Could not open urlgrab file $urlgrab_file" } \
else {
puts $fileid [join $urls "\n"]
close $fileid
}
}
}
foreach key $urlgrab_keys {
bind pubm - *$key* pubm_urlgrab
#bind msgm - *$key* msgm_urlgrab
}
#bind ctcp - ACTION ctcp_urlgrab
Ok this will grab urls and put them in a data file.
The thing is it writes the same url 3 times to the file and i really need just one writing per url, can anyone fix this? btw the variable "validnum" doesnt exist so i have put it away and i dont want it to grab by msg or ctcp so i have put that away also.
caesar wrote:Have you contacted the author and told him/her about this error? If not do it! Also, keep in mind that usualy on this forum we don't like to (nor do) debug other people scripts.
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
caesar wrote:Have you contacted the author and told him/her about this error? If not do it! Also, keep in mind that usualy on this forum we don't like to (nor do) debug other people scripts.
No i have not done that... From what i see this shouldnt be so hard to fix for someone that knows more tcl then me.
caesar wrote:Have you contacted the author and told him/her about this error? If not do it! Also, keep in mind that usualy on this forum we don't like to (nor do) debug other people scripts.
No i have not done that... From what i see this shouldnt be so hard to fix for someone that knows more tcl then me.
It would be prudent to contact the script author as a matter of course.
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
#########################################
# Urlgrab.tcl by KuNgFo0 (www.eggfaq.com)
Problem reading?
That site wont help me much all u can do request bug, and i dont think it will go fast to get it thru there so im asking here!
And no i dont have any problem reading, why dont u go pick on someone else.
You have supposedly found a 'bug' in a published script that the author may, or may not, be aware of.
It is proper that an author of a script is contacted regarding any errors in their script(s) so that they may correct it and then make available the corrected version for general use.
A little (very little) effort on the part of the person that discovers any Tcl script errors is required in that they make an effort to contact the author first and then, if there is no response or the author cannot be contacted (not so in this case), make a post requesting assistance.
Add [SOLVED] to the thread title if your issue has been. Search | FAQ | RTM
You have supposedly found a 'bug' in a published script that the author may, or may not, be aware of.
It is proper that an author of a script is contacted regarding any errors in their script(s) so that they may correct it and then make available the corrected version for general use.
A little (very little) effort on the part of the person that discovers any Tcl script errors is required in that they make an effort to contact the author first and then, if there is no response or the author cannot be contacted (not so in this case), make a post requesting assistance.
Ohh man i dont care about the author i only want this smal error to be fixed thats all, and Its _NO_ modification so i dont need to contact the author or anything. just want it fixed thats all and fixing somthing is not modifying a script right?.
So help if u can, dont need anymore info about authors and stuff plz.... just need this error fixed and i can't find were it is so i need help here.
MeJseL wrote:
Ohh man i dont care about the author
I'm sure he'd be thrilled to hear that from those benefiting from his hard work. If you don't care about the community, don't be surprised when it doesn't care about you. The correct process, as Alchera described, is to first contact the author to alert them of the bug, and if they release a fixed version, it benefits everyone. Reporting the bug and being patient is the minimum you can do as a user. If that doesn't work, then ask here.
MeJseL wrote:
Ohh man i dont care about the author
I'm sure he'd be thrilled to hear that from those benefiting from his hard work. If you don't care about the community, don't be surprised when it doesn't care about you. The correct process, as Alchera described, is to first contact the author to alert them of the bug, and if they release a fixed version, it benefits everyone. Reporting the bug and being patient is the minimum you can do as a user. If that doesn't work, then ask here.
I got angry that he kept bugging me all the time with author this author that instead of helping me whit the script that has one tiny error.
I'm sorry i do care about the author and thank him for his work.