Using this script you can scan the url headers for titles, it's main use was for an example but I've taken it upon myself to make it avaliable for mIRC Bots. You can change the trigger however you like. The current trigger is "\", which is chr(92). Sorry If I made it a bit confusing for some, but use it however you wish. It was mainly created to seak out fake urls of sorts, or if your bored and if you want to show your friends what YouTube video that is you wanted to show them without them thinking your RickRolling them :P. Please enjoy and leave any comments you may have or any script requests.
UPDATED THE CODE
on *:TEXT:$($+($chr(92),scanurl) *):#:{
set %scan_disphost $remove($left($remove($2,http://),$pos($remove($2,http://),/,1)),/)
set %scan_disppage $remove($2,http://,%scan_disphost)
.sockopen $+(scan,$r(99,9999999)) %scan_disphost 80
set %scan_url %scan_disphost
;;;;
; This example was made to show how a user can remove the beginning slash to show some pages. Some webservers require it.
set %scan_example $remove(%scan_disppage,$left(%scan_disppage,1))cc
set %scanurl_chan $chan
set %scanurl_nick $nick
}
on *:SOCKOPEN:scan*: {
sockwrite -nt $sockname GET %scan_disppage HTTP/1.1
sockwrite -nt $sockname Host: %scan_disphost
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:scan*: {
var %sockreader
sockread %sockreader
if (*<title>* iswm %sockreader) {
noop $regex(%sockreader,/<title>(.*?)<\/title>/Si)
set %scanurl_title $regml(1)
.msg %scanurl_chan Scanned: URL => " $+ %scan_url $+ " Title => " $+ %scanurl_title $+ "
}
}
I just now updated the code, it should work with pages like http://youtube.com/?v=blahblah. Enjoy! ^^
This is a saweeet snippet addon! Thanks!