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.

incith:xrl (r94) (Jan. 20th, 2009) (+TinyURL and x0.no)

Support & discussion of released scripts, and announcements of new releases.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

incith:xrl (r94) (Jan. 20th, 2009) (+TinyURL and x0.no)

Post by incith »

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>
Last edited by incith on Wed Jan 21, 2009 2:36 am, edited 29 times in total.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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-
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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.
User avatar
Domin
Halfop
Posts: 72
Joined: Sat Jun 10, 2006 9:10 am

Post by Domin »

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
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Yes, I noticed and fixed this earlier, please download the latest version (2.1) :)

http://egghelp.org/tcl.htm
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Version 2.2 released to fix auto shorten. See the first post for download.
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

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: Select all

# 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
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

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?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

line 170

Code: Select all

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: Select all

if {[regexp -- "(${prefix}.+?)(\s|$)" $input - auto_shorten_url] == 1} {
Keep in mind i'm not the most talented when it comes to regexp.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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,
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

Really...

[11:58:08] <me> blah blah http://www.google.com/teste/site.php blah blah
[11:58:22] <!Bot> me's url: http://xrl.us/z6i
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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 :D
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

url: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

How to fix it?
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

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.
User avatar
Domin
Halfop
Posts: 72
Joined: Sat Jun 10, 2006 9:10 am

Post by Domin »

Regards
Domin @ efnet
Post Reply