Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:TEXT:*:#opers,#Calmdown,#blaze.u,#friendly: {
- if ($regex($1-,/(www\.youtube\.com/watch.+)/)) {
- %data = $regml(1)
- var %x = 0
- while (%x <= $nick($chan,0)) {
- if ($regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
- var %is.jas.here = true
- inc %x
- }
- if (!$regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
- inc %x
- }
- if (%x == $nick($chan,0)) && (%is.jas.here != true) {
- youtube
- %youtube.chan = $chan
- }
- }
- }
- }
- on *:INPUT:#opers,#Calmdown,#blaze.u,#friendly: {
- if ($regex($1-,/(www\.youtube\.com/watch.+)/)) {
- %data = $regml(1)
- var %x = 0
- while (%x <= $nick($chan,0)) {
- if ($regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
- var %is.jas.here = true
- inc %x
- }
- if (!$regex($nick($chan,%x), /(^jas|_jas|foreplay)/)) {
- inc %x
- }
- if (%x == $nick($chan,0)) && (%is.jas.here != true) {
- youtube
- %youtube.chan = $chan
- }
- }
- }
- }
- alias youtube {
- %s = sockwrite -tn
- sockopen youtube www.youtube.com 80
- }
- on *:SOCKOPEN:youtube: {
- %s $sockname GET /watch? $+ $gettok($gettok(%data,2,63),1,32) HTTP/1.1
- %s $sockname Host: www.youtube.com $+ $str($crlf,2)
- }
- on *:SOCKREAD:youtube: {
- var %youtube | sockread %youtube
- if ($sockerr > 0) { echo -a Socket Error. }
- if (%youtube) {
- if ($regex(%youtube, /(<meta itemprop="name" content=".+">)/)) && (%is.jas.here != true) {
- %youtube.title = $regml(1)
- msg %youtube.chan 01,00You00,04Tube $trash($gettok(%youtube.title,3,61))
- }
- if ($regex(%youtube, /(</html>)/)) {
- sockclose $sockname
- }
- }
- }
- alias -l trash {
- var %x, %i = $regsub($1-,/(^"$)/g,$null,%x), %x = $remove(%x, ,',',>,<,")
- return %x
- }
- alias -l nohtml {
- var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,',')
- return %x
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement