Bitly url shortener

Platform:  mIRC
Published  Nov 29, 2009
Updated  Nov 29, 2009
Script was requested by Luke on irc.geekshed.net
Simple URL shortener for your bot.
You must turn this on from the right click channel or status menu. Under bitly, click trigger on.
Syntax is !bitly http://link.name
There is a ! trigger to notice the user and a @ trigger to message the channel. The @ trigger requires halfops or higher to use.

There is also an alias that can be typed from the client the script is loaded into.
Syntax /echobitly http://link.name.here

Example output:
17:09:51 <Ford_Lawnmower> @bitly http://pastebin.com/m63db9ac2
17:09:54 <+RingKing Searching Bitly .......
17:09:54 <+RingKing Bitly » http://bit.ly/7S3RJ7 ;Bitly Url Shortener by Ford_Lawnmower irc.mindforge.org #USA-Chat
menu Channel,Status {
.$iif($group(#Bitly) == On,$style(1)) Bitly Trigger
..$iif($group(#Bitly) == On,$style(2)) On: .enable #Bitly
..$iif($group(#Bitly) == Off,$style(2)) Off: .disable #Bitly
}
#Bitly off
On $*:Text:/^(!|@)Bitly.*/Si:#: {
if ($timer($+(Bitly,$network,$nick))) { return }
.timer $+ $+(Bitly,$network,$nick) 1 6 noop
var %method $iif($regml(1) == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
Bitly %method $2-
}
#Bitly end
alias EchoBitly { Bitly echo -a $1- }
alias -l Bitly {
$1-2 07Searching 04B06i07t09l03y........
var %sockname $+(Bitly,$network,$2,$ticks)
sockopen %sockname bit.ly 80
sockmark %sockname $1-2 $+(/?s=&keyword=&url=,$3-)
}
On *:sockopen:Bitly*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
sockwrite -n $sockname Host: bit.ly
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:Bitly*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %Bitly | sockread %Bitly
if ($regex(%bitly,/<input id="shortened-url" value="(.*)"/)) {
$gettok($sock($sockname).mark,1-2,32) 04B06i07t09l03y 04» $+(07,$regml(1),)
}
}
}

Comments

Sign in to comment.
FordLawnmower   -  Jan 14, 2012
@GTAXL Here is is.gd

  • Same as most of my scripts you need to activate for each channel (+gd/-gd)
  • Triggers are @gd !gd. The @ trigger will message the channel. The ! Trigger will notice the user.
  • Voice or higher is needed to use @gd. Ops or higher is needed to activate/deactivate the script in a channel.
  • There is an on off switch on channel/status popup.
  • Local alias for personal use : /is.gd
  • Edit the alias is.gd.logo to change the logo.

Code

 
 Respond  
GTAXL   -  Jan 13, 2012
You should really make one for is.gd :)
 Respond  
Fawkes   -  Aug 26, 2011
@FordLawnmower
Can you modified Url shorterer bit.ly like lshort ? with customize url.
 Respond  
FordLawnmower   -  Dec 28, 2010
Something seriously wrong with the bit.ly site. I'll have a look at it as soon as it stops ping flooding. It's a non-stop image download that sucks down your cpu's. Snow flakes I suppose.
 Respond  
Conscious   -  Dec 27, 2010
z.pe doesnt work for me anymore...

"Services for this domain have been discontinued"

Odd. Anyway, rather nice script! 7/10
 Respond  
MashhitDK   -  Dec 27, 2010
Just tried out the "original" script you posted plus the onces you posted here in comments.

Doesn't seem to be working... besides shadyurl which made Me laugh :P
Awesome work haha :P not quite what I'm looking for... but BiG UPs...
sure it will come in handy... :D:D

Anyways... I'm looking for something like tinyurl that will shorten the links to something not quite as shady :P
 Respond  
Raicho Ichisada   -  Jun 22, 2010
not work in my mirc :3
 Respond  
gogy_st   -  May 04, 2010
tnx
 Respond  
Luke   -  Mar 27, 2010
Wow Thanks Ford, that was quick. :)
 Respond  
FordLawnmower   -  Mar 26, 2010
Sure Luke. Here it is:

Code

 

The alias function also works on this. Example:
!lshort google.com mazogoogle
Will return -->> http://lshort.co.cc/mazogoogle
 Respond  
Luke   -  Mar 26, 2010
Hey Ford Could you make one for http://www.lshort.co.cc please Thanks :)
 Respond  
FordLawnmower   -  Mar 24, 2010
:)
 Respond  
montague   -  Mar 24, 2010
zomg.. that was too fast.. heh thanks Fordlawnmower
 Respond  
FordLawnmower   -  Mar 24, 2010
O.o That site is a little warped ;/
Here it is though :)

Code

 
 Respond  
montague   -  Mar 24, 2010
works perfecly.. 10/10!
if u could make an url looks more suspicious and frightening from http://www.shadyurl.com/
it will be much more fun :D just a thought :P
 Respond  
Luke   -  Dec 02, 2009
Ok Thanks

Also you know on This bit
sockmark %sockname $1-2 $+(/?s=&keyword=&url=,$3-)

is there a way you could make it so you can do !bitly www.google.co.uk google (<< = Keyword) << but the keyword can only be used by me?

So like then it would return bit.ly/google
 Respond  
FordLawnmower   -  Dec 01, 2009
No problem Luke :)
I'll let you know when I get to the other script.
 Respond  
Luke   -  Dec 01, 2009
Wow Ford (its me Luke) Thanks For this I always wanted a bitly converter script.

Any news on the other script I requested?

Thanks :D
 Respond  
FordLawnmower   -  Nov 30, 2009
Yep, that's about as short as it gets.
 Respond  
^Neptune   -  Nov 30, 2009
For example this is google: http://z.pe/1iF
And this is hawkee: http://z.pe/Fo1

Pretty short eh?
 Respond  
FordLawnmower   -  Nov 29, 2009
Yea, that's a good point sunslayer. It's weird , but that site will produce a link for anything you send it. I tried this -->> http://bit.ly/?s=&keyword=&url=gobblediegook
And the site spit out this -->> http://bit.ly/6cx8vo
This site will produce a valid link if you send it yahoo.com, www.yahoo.com, http://www.yahoo.com or http://yahoo.com
So, unless I wanted to write a routine to check the validity of a link before I run the bitly routine, there is not much I can check for. I suppose I could check for at least one .(dot), as the list of valid extensions is no longer limited to .com,.net,.edu, etc.
.ly , I sure never heard of that one.
 Respond  
sunslayer   -  Nov 29, 2009

Quote

btw, z.pe is the shortest URL shortener ever to exist.
thats what she said.

you should probably check to make sure that they are putting a url and not just some text
 Respond  
FordLawnmower   -  Nov 29, 2009
Oh, thanks for the info ^Neptune :) I've always used tinyurl.
 Respond  
^Neptune   -  Nov 29, 2009
btw, z.pe is the shortest URL shortener ever to exist.
 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.