This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Urlgrab.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Urlgrab.tcl

Post by MeJseL »

Code: Select all


#########################################
# 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!
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

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!
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

Alchera wrote:
MeJseL wrote:
Alchera wrote:
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!
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

#########################################
# Urlgrab.tcl by KuNgFo0 (www.eggfaq.com)
Problem reading?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

Alchera wrote:

Code: Select all

#########################################
# 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!
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

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!
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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. :P
Once the game is over, the king and the pawn go back in the same box.
M
MeJseL
Halfop
Posts: 61
Joined: Tue Nov 18, 2003 7:30 am
Location: Gothenburg , sweden

Post by MeJseL »

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!
Post Reply