Bradjoe96
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Bradjoe96


 
HomeSearchLatest imagesRegisterLog in

 

 TinyURL Script

Go down 
AuthorMessage
bradjoe96
Founder
Founder
bradjoe96


Warning Level : TinyURL Script WarningBar-Gloss1
Posts : 159
Points : 69347
Reputation : 600
Join date : 2009-03-29
Age : 28
Location : United States

TinyURL Script Empty
PostSubject: TinyURL Script   TinyURL Script Icon_minitimeMon Aug 31, 2009 9:59 am

Code:

alias tinyurl {
  var %c $iif($isid,return,echo -a)
  if ($1) && (!$com(u)) && (!$sock(tinyurl)) {
    if ($regex($1,/^(?:(?:f|ht)tps?:\/\/|[^<>\/:\s])+[^<>.:\/\s]+(?:\.[^\/:<>.\s]{2,6})+(?:\/.*?)?$/i)) {
      sockopen tinyurl www.tinyurl.com 80
      sockmark tinyurl /create.php?url= $+ $remove($1-,$chr(32))
      .comopen u Wscript.Shell
      .comclose u $com(u,run,1,bstr*,$(%comspec%,) /c ping.exe -n 2 127.0.0.1 >nul,uint,0,bool,true)
      %c $iif(%tinyurl,$v1,No result.)
    }
    else %c Invalid URL!
  }
  else %c $iif($1,Please be patient...,Input a URL!)
}
on *:sockopen:tinyurl: {
  if ($sockerr) {
    set -u3 %tinyurl Error connecting: $sock($sockname).wsmsg
    sockclose $sockname
  }
  else {
    sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
    sockwrite -n $sockname Host: tinyurl.com
    sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
    sockwrite -n $sockname $crlf
  }
}
on *:sockread:tinyurl: {
  if ($sockerr) {
    set -u3 %tinyurl Error connecting: $sock($sockname).wsmsg
    sockclose $sockname
  }
  else {
    var %x
    sockread %x
    if ($regex(%x,/<blockquote><b>(.*?)<\/b><br>/)) {
      set -u3 %tinyurl $regml(1)
      sockclose $sockname
    }
  }
}
on $*:TEXT:/^[.!@]tiny(url)? .*?$/Si:#: {
  if (!%tinyurl. [ $+ [ $2 ] ]) {
    var %c = $tinyurl($2)
    msg $chan $iif(error !isin %c && invalid !isin %c,TinyURL converted: %c $+([,From $len($2) to $len(%c) chars,]),%c)
    set -u5 %tinyurl. $+ $2 1
  }
Back to top Go down
https://bradjoe96.forumotion.net
 
TinyURL Script
Back to top 
Page 1 of 1
 Similar topics
-
» Away Script
» Dictionary Script
» Wikipedia Search Script
» Bot Logging Channel Script 5.00
» AKA Nick Tracker Script

Permissions in this forum:You cannot reply to topics in this forum
Bradjoe96 :: Scripting :: mIRC Scripting-
Jump to: