commented on a Page, Yet Another Youtube Title grabber  -  Feb 25, 2012

Just playing with it some..

on $*:text:/(youtube.com|youtu.be)\/(.*|v=)?([\w-]{11})/Si:*: {
  if ($sock(yt)) { sockclose yt }
  sockopen yt www.youtube.com 80 
  sockmark yt $regml(3) msg $iif($chan,$v1,$nick) $+(You,$chr(3),0,$chr(44),04,Tube,$chr(3)) Title: 
}  
on *:sockopen:yt:{
  tokenize 32 $sock(yt).mark
  sockwrite -n yt GET /watch?v= $+ $1 HTTP/1.1
  sockwrite -n yt HOST: www.youtube.com $+ $str($crlf,2)
} 
on *:sockread:yt:{
  var %v 
  sockread %v
  tokenize 32 $sock(yt).mark
  if ($regex(%v,/"name" content="(.+)"/)) { 
    $2- $replace($regml(1),&,$chr(38),',$chr(39),',$chr(39),",$chr(34),",$chr(34),&,$chr(38))
    sockclose yt
} }

you dont need the vars, Good idea on the replace tho you only need it once.

 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.