Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

YouTube URL

Recommended Posts

  • Administrators
>; ********** 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 $+  $+ }

}

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

Link to comment
Share on other sites



×
×
  • Create New...