Top

http preview


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  May 22, 2009
Last Updated  May 23, 2009
Tags  bot  echo  title  url  xero 

Description

Ok, so this just gives a hint as to what a url someone posts does. You can make it personal use or have it msg the chan. I'm working on getting it to work on tinyurls and other compressed addresses....not sure why it doesn't so any help in that department would be much appreciated. I'm thinking to use a separate socket for specific tinyurls

I used Gummo's $between...

eventual update will hopefully work for redirects like tinyurl and other url compression sites...this was more about learning socket and is my first "finished" socket script

Grab the Code

on *:text:*http*:#: { 
    var %x $1-
    var %z 1
    while (%z <= $numtok(%x,32)) {
      if (http:// isin $gettok(%x,%z,32)) { /urlcheck $chan $gettok(%x,%z,32) | BREAK }
      /inc %z 1
    }
  }
 
 
alias urlcheck {
  unset %url.*
  set %I $ticks
  set $+(%,url.chan.,%I) $1
  set $+(%,url.check.,%I) $replace($2,http://,$null)
  set $+(%,url.host.,%I) $gettok($eval($+(%,url.check.,%I),2),1,47)
  set $+(%,url.get.,%I) $replace($eval($+(%,url.check.,%I),2),$eval($+(%,url.host.,%I),2),$null)
  sockopen $+(remoteurl.,%I) $eval($+(%,url.host.,%I),2) 80
}
 
on *:SOCKOPEN:remoteurl.*: {
  sockwrite -n $sockname GET $+($chr(47),$($eval($+(%,url.get.,%I),2)))
  sockwrite -n $sockname Host: $($eval($+(%,url.host.,%I),2))
  sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 $+ $crlf $+ $crlf
}
 
on *:SOCKREAD:remoteurl.*: {
  var %r
  sockread %r
  if ($regex(%r,<title>)) {
    ;msg $eval($+(%,url.chan.,%I),2) ' $+ $between(%r,<title>,</title>,1) $+ ' (at ' $+ $eval($+(%,url.host.,%I),2) $+ ') 
    .echo $eval($+(%,url.chan.,%I),2) ' $+ $between(%r,<title>,</title>,1) $+ ' (at ' $+ $eval($+(%,url.host.,%I),2) $+ ') 
  }
}
 
; Gummo's
alias between { 
  noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi) 
  return $regml($4) 
}

Comments

  (1)  RSS
Xaric
Comments: 14
 
mIRC Snippet:  http preview
Posted on Jul 30, 2009 12:03 am
* /sockopen: insufficient parameters

Get this when I say a url.

Commenting Options

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

  

Bottom