ProIcons commented on a Page, Yet Another Youtube Title grabber  -  Feb 25, 2012
on *:text:*:*: {
    if ($regex($1-,/youtube.com.*v=([^&]+)/)) { /set %yt.target $iif($chan,$v1,$nick) | /set %yt.url /watch?v= $+ $regml(1) | /sockclose yt | /sockopen yt youtube.com 80 }
    if ($regex($1-,/youtu.be.([^/]+[^/])/)) { /set %yt.target $iif($chan,$v1,$nick) | /set %yt.url /watch?v= $+ $regml(1) | /sockclose yt | /sockopen yt youtube.com 80 }
  }

;-------------------------------------------;
;           Socket for yt title             ;
;-------------------------------------------;
on *:SOCKOPEN:yt: {
  sockwrite -n $sockname GET %yt.url HTTP/1.1
  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:yt: {
  /var %yt.temp | /sockread %yt.temp
  if ($regex(%yt.temp,/<meta name="title" content="(.*?)">/)) {
    /set %yt.title $regml(1)
    if (%yt.target != $null) { /sockclose yt | /msg %yt.target 1,0You0,4Tube14,1: $replace($replace($replace($replace($replace($replace(%yt.title,&amp;amp;,$chr(38)),&amp;#39;,$chr(39)),&#39;,$chr(39)),&amp;quot;,$chr(34)),&quot;,$chr(34)),&amp;,$chr(38)) | /unset %yt.*  }
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.