Top

Get Title


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  3.0 (of 1 scores)
Date Added  Aug 18, 2008
Last Updated  Aug 18, 2008
Tags  get  mirc  scripting  staticx  system  title 

Introduction

--
It returns the title of the website you\'ve typed in a channel.
Syntax: !title website
Example: !title www.hawkee.com

:)

Grab the Code

on *:TEXT:*:#:{
  if ($1 == !title) {
    if ( $2 ) {
      set %title_site $2
      set %title_chan $chan
      get_title $2
    }
    else { msg $chan Please Enter A WebSite }
  }
}
 
alias get_title {
  if ( $sock(get_title) == get_title ) {
    sockclose get_title
  }
  if ( !%title_site ) {
    echo -a Get title for: ?
  }
  else {
    sockopen get_title %title_site 80
  }
}
 
on *:sockopen:get_title:{
  if ($sockerr > 0) {
    echo -a Error: $sock(get_title).wsmsg
  }
  else {
    sockwrite -tn $sockname GET / HTTP/1.1    
    sockwrite -n $sockname Accept: */*
    sockwrite -tn $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 $+ $crlf
    sockwrite -n $sockname Host: %title_site
    sockwrite -n $sockname Connection: close
    sockwrite -n $sockname $crlf $+ $crlf
  }
}
 
on *:sockread:get_title:{
  if ($sockerr > 0) return
  sockread &get_titling
  if ($sockbr == 0) return -
  else {
    if ( $bfind(&get_titling,1,title) ) {
      set %start_pos $bfind(&get_titling,1,title)
      set %end_pos $bfind(&get_titling,$calc($bfind(&get_titling,1,title) + 5 ),title)
      set %now_this_is_title $remove($bvar(&get_titling,%start_pos,$calc(%end_pos - %start_pos)).text,title>,</)
      msg %title_chan Title for %title_site $+ : %now_this_is_title
      sockclose get_title
    }
  }
}
 

Comments

  (1)  RSS
Hawkee
Comments: 1,039
 
mIRC Snippet:  Get Title
Posted on Aug 18, 2008 3:03 pm
Interesting concept, but I don't see a whole lot of value in it. Maybe this could be adapted to collect information on URL's mentioned in a channel in order to build a search engine bot.

Commenting Options

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

  
Bottom