| View previous topic :: View next topic |
| Author |
Message |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Wed Apr 05, 2006 12:28 pm Post subject: incith:xrl (r94) (Jan. 20th, 2009) (+TinyURL and x0.no) |
|
|
Newest versions of my scripts are always available @ incith.com if they are not yet available on the Tcl archive.
incith:xrl will shorten long url's into short xrl.us/abcd url's. It will also watch a channel for long URL's and shorten them automatically if they are over a set length. You can also un-shorten a URL (as long as it was shortened using the bot, for some reason, url's posted directly on xrl.us webpage do not have their long-url stored).
!shorten or !xrl http://long.url.com
!lengthen or !unxrl abcd -or- xrl.us/abcd
As well the bot will store URL's for future shortening, example:
<user> http://some.long.url
<bot silently remembers this URL, for this channel>
<user2> !shorten <or you can specify a nickname/channel to shorten the last url>
<bot> last url: <it will then shorten http://some.long.url> _________________ ; Answer a few unanswered posts!
Last edited by incith on Wed Jan 21, 2009 2:36 am; edited 29 times in total |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Sat Nov 18, 2006 9:39 pm Post subject: |
|
|
I've updated this script to v1.4, fixes auto shorten to work properly (only checks the length of the URL within the message now, instead of the length of the entire message), and I also fixed auto shorten not working in private messages.
It can be downloaded temporarily until the Tcl archive updates, from here: -link expired- _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Sun Nov 19, 2006 4:34 pm Post subject: |
|
|
Ah, I've made a 2.0 version to bring the script up to date a bit more with my other scripts.
Download available in the first post. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
Domin Halfop

Joined: 10 Jun 2006 Posts: 72
|
Posted: Wed Nov 22, 2006 4:59 pm Post subject: |
|
|
No matther how i set the script up it keeps ignoring all users in the channel
[01:52] incith:xrl-2.0: flood detected from Domin.
[01:54] incith:xrl-2.0: flood detected from Martin\-.
[01:54] incith:xrl-2.0: flood detected from Nille.
even thou non of them writes and says anything one of them is my self even thou im botnet master.
Hope you can help  _________________ Regards
Domin @ efnet |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Thu Feb 01, 2007 2:02 pm Post subject: |
|
|
Version 2.2 released to fix auto shorten. See the first post for download. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Thu Jul 05, 2007 11:52 pm Post subject: |
|
|
Hi, I just instaled this tcl (v2.2) and work fine with commands like !shorten url, but automatic work dont work. See my config:
| Code: | # minimum length a url has to be to auto-shorten it
variable minimum_length 15
# prefixes that you want the bot to watch for, to auto-shorten them
variable prefixes "http:// ftp:// www."
# number of minute(s) to ignore flooders, 0 to disable flood protection
variable ignore 1
# how many requests in how many seconds is considered flooding?
# by default, this allows 3 queries in 10 seconds, the 4th being ignored
# and ignoring requests for 'variable ignore' minutes
variable flood 4:10 |
Any idea? my eggdrop is version 1.6.17 running on FreeBSD 6 |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Sun Jul 08, 2007 12:31 am Post subject: |
|
|
The automatic parse is not working.
And the tcl doesn't show any error.
It only works when it uses the command !shorten url
What can be? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Jul 08, 2007 3:51 am Post subject: |
|
|
line 170 | Code: | | if {[regexp -- "(${prefix}.+)\[\\s+\]" $input - auto_shorten_url] == 1} { |
I think it's the use of escapes that is throwing off detection. You can try: | Code: | | if {[regexp -- "(${prefix}.+?)(\s|$)" $input - auto_shorten_url] == 1} { |
Keep in mind i'm not the most talented when it comes to regexp. |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Sun Jul 08, 2007 2:59 pm Post subject: |
|
|
The auto detection has never been perfect unfortunately. It will work if you type something before the url and perhaps after it, such as 'blah blah http://www.google.com blah blah', then it will pick it up.
That's where the problem comes in, I could never come up with a regexp to do this properly, to pick the url out of a string, and check just the url's length, it ends up grabbing other stuff, and bleh. But I'd be more than happy to incorporate a new RE.
Regards, _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Tue Jul 17, 2007 12:27 pm Post subject: |
|
|
Yeah, I haven't looked at the code in awhile. It still works when it does convert a URL, just it's not checking the URL's length but the entire message instead which is where the problem comes in.. You type 'blah blah blah www.shorturl.com blah (blah blah.....)' and even tho its just "www.shorturl.com" it's still going to convert it because the whole sentence was longer than the 'auto length'.
Anyway, I'll fix it up one of these days  _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Fri Oct 19, 2007 3:16 pm Post subject: |
|
|
url: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
How to fix it? |
|
| Back to top |
|
 |
incith Master

Joined: 23 Apr 2005 Posts: 275 Location: Canada
|
Posted: Wed Feb 20, 2008 10:55 pm Post subject: |
|
|
Sorry I never seen the above posters comment, I have also never had the error shown happen to me.
I've released version 2.3, which fixes auto shorten problems, it should now capture just the URL and thus check the length properly, I tested it on a few URL's, URL's inside sentences, etc, with ports, without ports, with things like .com/?blah=foo with .co.uk type TLD's and so on. All the tests passed and grabbed just the URL. So if you set variable minimum_length to something sane and someone says a long URL in the channel, the bot will auto-shorten it, and not take the rest of the sentence into account as part of the URL's length anymore. Hope that makes sense!
Prefixes were removed as we are only going to be capturing http(s) and www anyway, I tried giving xrl an ftp:// address and it failed. Suggestions welcome. As I mentioned a few posts up I still have plans for this script, this was just a long, long needed fix.
Updates: I'm working on this script again, currently I've added TinyURL support to it. Any other sites you may want included please post here. _________________ ; Answer a few unanswered posts! |
|
| Back to top |
|
 |
Domin Halfop

Joined: 10 Jun 2006 Posts: 72
|
|
| Back to top |
|
 |
|