Tinyurl A URL

By Back2Life on Dec 27, 2010

Simply attach this to your bot and whenever people type !tiny their urls will become tinyurl version.

on *:TEXT:!tiny*:#: { msg $chan Congratulations $nick $+ ! Your current url of $2 has been shortened at http://tinyurl.com/create.php?source=indexpage&url= $+ $2 $+ &submit=Make+TinyURL!&alias= Thank you for using the script! }

Comments

Sign in to comment.
MashhitDK   -  Dec 28, 2010

Well anyways nice work... and yeah it does indeed work... was just trying to show a other way to go about it.

First of all $strip($2) is pretty important in cases it's a link copied with color ect. not sure it will give the right link if you don't use strip. - But didn't test it...
And instead of using

http://tinyurl.com/create.php?source=indexpage&url= $+ $2 $+ &submit=Make+TinyURL!&alias=

you could use

$+(http://tinyurl.com/create.php?source=indexpage&url=,$2,&submit=Make+TinyURL!&alias=)

Looks cleaner I think... but the script does what it's suppose to ;D

  • And it's just another way to go about it.
    And regarding a checker... that would come in handy just in case...
    But it's not something I normally think of either...
on *:TEXT:!tiny*:#: { 
if (http !isin $1-) || (. !isin $1-) { msg # ERROR! - Might just be Me... but $+(,$strip($2),) doesn't seem to be a link ? | halt }
msg # Congratulations $+($nick,!) Your current url of $+(,$strip($2),) has been shortened at $+(2,http://tinyurl.com/create.php?source=indexpage&url=,$strip($2),&submit=Make+TinyURL!&alias=,) - Thank's for using the script! }

NOTE: Above script is written here... it's not tested ( should still work ) it's just an example on how to go about it.

 Respond  
Conscious   -  Dec 28, 2010

he has an odd sense of humour, I've talked to mix on irc xD

 Respond  
Back2Life   -  Dec 28, 2010

Conscious: Okay, you can use that script. I don't really need flood protection. But if I do then I'll use yours. :/

MixXeduP: What is so funny?

 Respond  
MixXeduP   -  Dec 28, 2010

Lmao

 Respond  
Conscious   -  Dec 28, 2010

It would indeed require a socket, I haven't looked at the use of sockets either.

Idiot proof scripts are the way of the future.

Strip and flood timer:

on *:TEXT:!tiny*:#: { 
if (%flood_protection_tiny != on) {
var %url $strip($2)
msg $chan Congratulations $nick $+ ! Your current url of %url has been shortened at http://tinyurl.com/create.php?source=indexpage&url= $+ %url $+ &submit=Make+TinyURL!&alias= Thank you for using the script! 
set %flood_protection_tiny on
timer 1 3 unset %flood_protection_tiny
}
else msg $chan Please do not spam this command!
}

Also, do you want the custom alias bit added? Not too hard...

KryptonCnR  -  Nov 28, 2013

I know this is quite a old thread, but is there a way to get the link to display in the room without having to go to the site to get it?

Conscious  -  Dec 01, 2013

Using a socket, yes

Sign in to comment

Back2Life   -  Dec 28, 2010

MashhitDK: I think just fetching the URL would require the use of sockets, and I do not know how to use them. I'll try to learn them sometime soon.

Conscious: Well, I don't really see the need for a checker. I don't know why someone would post a fake URL. :/

 Respond  
Conscious   -  Dec 28, 2010

It works.

Maybe needs a checker to see if it's an actual url, perphaps, with a flood timer and and a strip.

 Respond  
MashhitDK   -  Dec 27, 2010

Haha... not at all what I thought it was :P

Anyways... nice work I guess... was just about to post one with $replace(r) :P

  • Here is a other way to go about it
on *:TEXT:!tiny*:#: { msg # Congratulations $+($nick,!) Your current url of $+(,$strip($2),) has been shortened at $+(2,http://tinyurl.com/create.php?source=indexpage&url=,$strip($2),&submit=Make+TinyURL!&alias=,) - Thank's for using the script! }

Any chance of making this work on a BOT so it will fetch the tiny URL automatically ?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.