Top

Automatic TinyURL Converter


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.0 (of 2 scores)
Date Added  Jul 02, 2008
Last Updated  Jul 02, 2008
Tags  converter  tiny  tinyurl 

Introduction

All the credits of this snippets goes to the original poster: Daveoh, and the original work can be found here: http://www.hawkee.com/snippet/2041/

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.

Cheers
essebi

Grab the Code

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 tinyurl.com 80
}
alias tinyurl { 
  set -u3 %tinyspam 1 
  set %tinyurl1 $1 
  if ($sock(tinyurl)) { sockclose tinyurl } 
  sockopen tinyurl tinyurl.com 80 
} 
on *:sockopen:tinyurl:{ 
  sockwrite -n $sockname GET /create.php?url= $+ %tinyurl1 HTTP/1.0 
  sockwrite -n $sockname Host: tinyurl.com 
  sockwrite -n $sockname user-agent: Mozilla/?? 
  sockwrite -n $sockname Connection: Keep-Alive 
  sockwrite -n $sockname $crlf 
} 
on 1:sockread:tinyurl:{ 
  :nextread 
  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 
} 

Comments

  (4)  RSS
SuPeRFlY
Comments: 22
 
mIRC Snippet:  Automatic TinyURL Converter
Posted on Aug 26, 2008 9:38 pm
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?
SuPeRFlY
Comments: 22
 
mIRC Snippet:  Automatic TinyURL Converter
Posted on Aug 28, 2008 4:34 pm
just an update .. this script works perfect .. sorry for the doubts :)
VinX
Comments: 56
 
mIRC Snippet:  Automatic TinyURL Converter
Posted on Jul 31, 2009 8:46 am
{ msg %tinyurlchan %tinyurl2 }


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

like

{ msg ,,%tinyurlchan %tinyurl2 ,,}
miniCruzer
Comments: 47
 
mIRC Snippet:  Automatic TinyURL Converter
Posted on Sep 3, 2009 8:19 pm
Well done, sir.

Code:

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

(line 34)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom