Automatic TinyURL Converter

By essebi on Jul 02, 2008

All the credits of this snippets goes to the original poster: Daveoh, and the original work can be found here:

I edited it with wildcard for automatically catch every url on the chan and convert it into a tinyurl. You can think this edit is useless, but on my chan is really appreciated.

I've removed all triggers, and of course need to loaded on a bot.


on *:TEXT:*http*:*:{
  if (%tinyspam) { halt }
  if (*http://tinyurl* iswm $1-) { halt }
  set -u3 %tinyspam 1
  set %tinyurlchan $chan
  var %tinytemp $1-
  set %tinyurl1 $wildtok(%tinytemp,http*,1,32)
  if ($sock(tinyurl)) { sockclose tinyurl }
  sockopen tinyurl 80
alias tinyurl { 
  set -u3 %tinyspam 1 
  set %tinyurl1 $1 
  if ($sock(tinyurl)) { sockclose tinyurl } 
  sockopen tinyurl 80 
on *:sockopen:tinyurl:{ 
  sockwrite -n $sockname GET /create.php?url= $+ %tinyurl1 HTTP/1.0 
  sockwrite -n $sockname Host: 
  sockwrite -n $sockname user-agent: Mozilla/?? 
  sockwrite -n $sockname Connection: Keep-Alive 
  sockwrite -n $sockname $crlf 
on 1:sockread:tinyurl:{ 
  if ($sockerr > 0) return 
  sockread %temp 
  if ($sockbr == 0) return 

  if (<blockquote><b>* iswm %temp && $left($replace(%tinyurl1,&,&amp;),15) !isin %temp) {
    set %tinyurl2 $remove($gettok(%temp,2,60),b>)
    if (%tinyurlchan) { msg %tinyurlchan %tinyurl2 }
    else { echo -a Accorciato in %tinyurl2 }
    unset %tinyurl*
  goto nextread 


Sign in to comment.
jasonh   -  Jul 26, 2010

Thanks for this! works great.

miniCruzer   -  Sep 03, 2009

Well done, sir.

 if (%tinyurlchan) { msg %tinyurlchan 0,12TinyURL: 12 $+ %tinyurl2 $+  0,4Original: 12 $+ %tinyurl1 }

(line 34)

VinX   -  Jul 31, 2009

{ msg %tinyurlchan %tinyurl2 }

should i change there in order to give it color or make it bold ?


{ msg ,,%tinyurlchan %tinyurl2 ,,}

SuPeRFlY   -  Aug 28, 2008

just an update .. this script works perfect .. sorry for the doubts :)

SuPeRFlY   -  Aug 26, 2008

Is there a way to actualy make this work?. I typed in an HTTP url and this didn't do anything. looks like a great tool to have. maybe i'm missing something?

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.