################################
Connects the Youtube-Page if somebody types YoutubeURL.
Ready the Meta-Title Name and posts to the Channel.
Screenshot:
alias xconnection { set %tmpx $remove($1,http://,youtube,.com,www.) | sockopen youtube youtube.com 80 }
on *:SOCKOPEN:youtube:{
; connection
sockwrite -n $sockname GET %tmpx HTTP/1.1
; Write Connection Details
sockwrite -n $sockname Host: www.youtube.com
sockwrite -n $sockname User-Agent: IRCSpider/mIRC $version
sockwrite -n $sockname Accept: *.*, */*
sockwrite -n $sockname Referer: $server
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname Content-Type: text/html
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:youtube:{
sockread %mirc.temp
if (<meta name="title" content=" isin %mirc.temp) {
if (%d == 1) { }
else {
msg %tmp.chan 01You0,4Tube: $remove(%mirc.temp,<meta name="title" content=",">)
inc %d
}
}
}
on *:SOCKCLOSE:youtube:{ /noop }
on *:TEXT:*:#:{
set %tmp.chan $chan
unset %d
var %i 1
while ([ $chr(36) $+ [ %i ] ]) {
if (youtube.com/watch?v= isin [ $chr(36) $+ [ %i ] ]) { sockclose youtube | xconnection [ $chr(36) $+ [ %i ] ] }
inc %i
}
}