egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

incith:xrl (r94) (Jan. 20th, 2009) (+TinyURL and x0.no)
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Wed Feb 27, 2008 2:31 am    Post subject: Reply with quote

2.5 released with TinyURL support and vast other code changes I think. Please report any problems. Smile Script has been well overdue for these fixes.
_________________
; Answer a few unanswered posts!
Back to top
View user's profile Send private message
hippytyre
Voice


Joined: 26 Feb 2008
Posts: 1
Location: Scotland

PostPosted: Wed Feb 27, 2008 5:26 am    Post subject: Reply with quote

Thanks for releasing all of these scripts incith. I've been using your google one for a while now and after finding these forums earlier this week i've started using a few more of your tcls. Nice work Very Happy
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Wed Feb 27, 2008 3:50 pm    Post subject: Reply with quote

very usefull, I use this script at a long time.

The support to tinyurl was that lacked.

Thank you!
Back to top
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Wed Feb 27, 2008 5:20 pm    Post subject: Reply with quote

I think there may be a problem with how I changed the binds.. for some reason unknown to me, public messages have stopped working due to modifying how I bind the binds slightly.

If after you do a .die your bot's xrl is not working in channels please download 2.5a.
_________________
; Answer a few unanswered posts!
Back to top
View user's profile Send private message
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Fri Feb 29, 2008 4:34 pm    Post subject: Reply with quote

Tcl error [incith::xrl::message_handler]: Unsupported URL: http://metamark.net/api/rest/simple?long_url=http://br.youtube.com/watch?v=u21SkCX7h18

if char '?' is present in url, show this error.

Can you fix it?

Thank you!
Back to top
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Fri Feb 29, 2008 9:04 pm    Post subject: Reply with quote

testebr wrote:
if char '?' is present in url, show this error.

Sorry about that, I had removed them because I didn't think it was necessary anymore. (them = ? and &). I have released version 2.5b to address this problem on my website.
_________________
; Answer a few unanswered posts!
Back to top
View user's profile Send private message
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Sat Mar 01, 2008 12:17 am    Post subject: Reply with quote

Very nice, to shorten work fine, but to lengthen still with error..

Quote:
[01:11:10] <me> !shorten http://www.orkut.com/AlbumZoom.aspx?uid=117098017202200776477987&pid=3&aid=1
[01:11:11] <MyBot> url's: http://tinyurl.com/2ttpzw
[01:11:16] <me> o/
[01:11:22] <me> !lengthen http://tinyurl.com/2ttpzw
[01:11:23] <MyBot> me's url's: http://www.orkut.com/AlbumZoom.aspx%3Fuid=117098017202200776477987%26pid=3%26aid=1


And the lengthen is invalid with theses chars '%' and '3%'.

Easy to fix I believe.

Cya
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Mar 01, 2008 3:23 am    Post subject: Reply with quote

Code:
proc UrlDecode {text} {
  set url ""
  regsub -all {\%([0-9a-fA-F][0-9a-fA-F])} $text {[format %c 0x\1]} text
  set text [subst $text]
  foreach byte [split [encoding convertto utf-8 $text] ""] {
    scan $byte %c i
    if { $i < 33 || $i > 127 } {
      append url [format %%%02X $i]
    } else {
      append url $byte
    }
  }
  return $url
}

A simple urldecoder (such as above) is all it needs. Wink
Back to top
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Sat Mar 01, 2008 6:26 am    Post subject: Reply with quote

Sigh.. slennox is gonna slaughter me one day with all the cancellations I do.

I have released 2.5c to hopefully address the above issues. % codes should always be converted now thanks to the above proc in a lengthen. Thanks, speechles.

Quote:
(03:35:18) (@incith) !untiny 2ttpzw
(03:35:20) <@visitant> incith's lengthened url: http://www.orkut.com/AlbumZoom.aspx?uid=11709801720220077647&pid=3&aid=1


Edit: I just can't help myself. 2.5d released, all URL's appear to lengthen quite nicely now.
_________________
; Answer a few unanswered posts!


Last edited by incith on Sat Mar 01, 2008 7:56 am; edited 1 time in total
Back to top
View user's profile Send private message
madwoota
Halfop


Joined: 09 Aug 2005
Posts: 53

PostPosted: Sat Mar 01, 2008 7:05 am    Post subject: Reply with quote

Haha, I've been meaning to write a scripted char to/from %code like that for years.

Nicely done speechles, I just might have to steal that Smile

(With credit of course!)

-madwoota
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Mar 01, 2008 3:50 pm    Post subject: Reply with quote

Code:
proc UrlEncode {text type} {
  set url ""
  foreach byte [split [encoding convertto utf-8 $text] ""] {
    scan $byte %c i
    if {$i < 65 || $i > 122} {
      append url [format %%%02X $i]
    } else {
      append url $byte
    }
  }
  if {$type == 1} {
    return [string map {%25 . %3A : %2D - %2E . %30 0 %31 1 %32 2 %33 3 %34 4 %35 5 %36 6 %37 7 %38 8 %39 9 % .} $url]
  } else {
    return [string map {%3A : %2D - %2E . %30 0 %31 1 %32 2 %33 3 %34 4 %35 5 %36 6 %37 7 %38 8 %39 9 \[ %5B \\ %5C \] %5D \^ %5E \_ %5F \` %60} $url]
  }
}

Just for laughs and perhaps others use (stealing is fine in this case), here is the corresponding urlencode.
The mundane [string maps { }] are neccessary to keep numerics and other required symbols from being %percentualized/encoded. The $type is only useful for doing this on more than one encoding style. Sites such as wikipedia (type 1 in code above) that require almost everything encoded with periods . , while every other site including google uses percents % .
Back to top
View user's profile Send private message
incith
Master


Joined: 23 Apr 2005
Posts: 275
Location: Canada

PostPosted: Sat Mar 01, 2008 4:34 pm    Post subject: Reply with quote

This would be really useful in a lot of places.

I decided against its use in xrl for now because I do not want to store urls as http%##%##%##www blah blah (yes I am too lazy to look up the codes for ://, still waking up), and is also why I removed % from being converted to %25 in 2.5d, I tested an ebay link stuffed with %'s and it still returned fine, the urlDecode making it even prettier now on a !lengthen.

There may still be some obscure URL/characters that will break xrl in the future, I didn't test curly braces for example, but I want to believe it's 99% good now.
_________________
; Answer a few unanswered posts!
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Mar 01, 2008 5:01 pm    Post subject: Reply with quote

incith wrote:
This would be really useful in a lot of places.

I decided against its use in xrl for now because I do not want to store urls as http%##%##%##www blah blah (yes I am too lazy to look up the codes for ://, still waking up), and is also why I removed % from being converted to %25 in 2.5d, I tested an ebay link stuffed with %'s and it still returned fine, the urlDecode making it even prettier now on a !lengthen.

There may still be some obscure URL/characters that will break xrl in the future, I didn't test curly braces for example, but I want to believe it's 99% good now.

Since your merely shortening url's your prolly closer to 99.999%. Your regexp is defining what gets sent off for url query (cleansing before querying). Which is neccessary because your anticipating links within context (hard to do). I only provided the urlencode function because the urldecode was mentioned in this thread. Imagined they could share mention in this thread and hopefully act as a reference in the future for someone suffering similar issues.. Theft is encouraged, this is a sharing community. Wink

Note: this helps get around the accented character problem when dealing with multiple languages as input.
Back to top
View user's profile Send private message
grrmisfit
Voice


Joined: 29 Mar 2008
Posts: 6

PostPosted: Sun Mar 30, 2008 8:02 pm    Post subject: Reply with quote

if demond doesnt mind id love to see this incorporated into his rss feed script. google news links are HUGE since they have referal links in them so it can be quite spamming to have them in there. i may try to modify the two to be one but since im not a tcl coder it wont be to easy
Back to top
View user's profile Send private message
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Tue Aug 12, 2008 9:39 am    Post subject: Reply with quote

founded one small bug with xrl

[10:34:18] <me> !xrl www.youtube.com/watch?v=_LNkqRQ1u0c
[10:34:19] <Bot> http://xrl.us/onehr

Without http:// the result will be:

xrl.uswww.youtube.com/watch?v=_LNkqRQ1u0c

-------------------------------------------------------------------

[10:35:30] <me> !xrl http://youtube.com/watch?v=_LNkqRQ1u0c
[10:35:31] <Bot> http://xrl.us/onemv

With http:// the result will be:

http://youtube.com/watch?v=_LNkqRQ1u0c

It's possible to fix this problem?

Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber