| View previous topic :: View next topic |
| Author |
Message |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Sat Feb 04, 2006 2:46 pm Post subject: Urlgrab.tcl |
|
|
| Code: |
#########################################
# 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. _________________ yeah! |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Feb 04, 2006 7:34 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Sat Feb 04, 2006 8:19 pm Post subject: |
|
|
| Alchera wrote: | | 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. _________________ yeah! |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Feb 04, 2006 8:45 pm Post subject: |
|
|
| MeJseL wrote: | | Alchera wrote: | | 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 |
|
| Back to top |
|
 |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Sun Feb 05, 2006 1:55 am Post subject: |
|
|
| Alchera wrote: | | MeJseL wrote: | | Alchera wrote: | | 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. |
well i'm asking for help here now am i? i dont know how to contact the author. _________________ yeah! |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Feb 05, 2006 3:03 am Post subject: |
|
|
| Code: | #########################################
# Urlgrab.tcl by KuNgFo0 (www.eggfaq.com) |
Problem reading? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Sun Feb 05, 2006 3:48 pm Post subject: |
|
|
| Alchera wrote: | | Code: | #########################################
# 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. _________________ yeah! |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Feb 05, 2006 9:52 pm Post subject: |
|
|
kungfo0@techmonkeys.org
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 |
|
| Back to top |
|
 |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Mon Feb 06, 2006 11:39 am Post subject: |
|
|
| Alchera wrote: | kungfo0@techmonkeys.org
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. _________________ yeah! |
|
| Back to top |
|
 |
slennox Owner

Joined: 22 Sep 2001 Posts: 593
|
Posted: Mon Feb 06, 2006 1:10 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 06, 2006 3:40 pm Post subject: |
|
|
Actualy I did said first to contact the author and tell him/her about the error, or at least Alchera quoted me heh, just kidding.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
MeJseL Halfop
Joined: 18 Nov 2003 Posts: 61 Location: Gothenburg , sweden
|
Posted: Mon Feb 06, 2006 5:01 pm Post subject: |
|
|
| slennox wrote: | | 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. _________________ yeah! |
|
| Back to top |
|
 |
|