Sign in to follow this  
chain

YouTube URL

>; ********** YOUTUBE ****************************

on *:text:*youtube.com/watch?v=*:#: {

 if (!$sock(youtube)) {

   noop $regex($strip($1-),http:\/\/.*youtube.*\/watch\?v=(.{11})&?.*)

   sockopen youtube www.youtube.com 80 | sockmark youtube $+(#,>,$regml(1))

   .set %youtubechan $chan

 }

}

on *:sockopen:youtube: {

 sockwrite -n $sockname GET $+(/watch?v=,$gettok($sock(youtube).mark,2,62)) HTTP/1.0

 sockwrite -n $sockname Host: www.youtube.com

 sockwrite -n $sockname $crlf

}

on *:sockread:youtube: {

 var %x | sockread %x

 if ($regex(%x,))  set %youtubetitle $regml(1)

 elseif ($regex(%x,(.+)

))  set %youtubeviews $regml(1)

 elseif ($regex(%x,(.+)))  set %youtubedate $regml(1)

 elseif ($regex(%x, ))  set %youtuberating $regml(1)

 elseif ($regex(%x,))  set %youtubeuser $regml(1)

}

alias youtubelike {

 .set %youtubelikes $1 $2

}

alias youtubedisl {

 .set %youtubedislikes $3 $4

}

on *:sockclose:youtube: {

 .youtubelike %youtuberating

 .youtubedisl %youtuberating

 msg %youtubechan ( $+ 1,0You0,4Tube $+ ) 14Title:7 %youtubetitle $+  14Views:10 %youtubeviews $+  $& ( $+ 12 $+ %youtubelikes $+ 4 %youtubedislikes $+  $+ ) 14By:10 %youtubeuser $+  {14Uploaded on:10 %youtubedate $+  $+ }

}

; ************************************************

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this