All pastes #929993 Raw Edit

Youtube URL Catcher

public text v1 · immutable
·published 2008-03-06 05:26 UTC
rendered paste body
; based in part on Holz's highlights window seen on http://www.mpcforum.com/showthread.php?t=128044&page=2
; this script basically matches highlights of *youtube.com/watch* and shows them in a @YouTube
; window while also writing them to file in youtube.txt in your current dir that mIRC runs from
; (I suppose as reference, in case you close the @YouTube window)
;
; I had plans to make it such that using sockets, the script would look up the title and
; description of the video and report it on the @YouTube window and write it to youtube.txt,
; but I was running into trouble because the title and description wasn't being reported
; properly. The script was displaying previous *youtube.com/watch* matches'title and
; description instead of the one asked.... Anyhow if you have any ideas on that here
; is what it looks like:
;
; http://pastebin.ca/339735

on *:text:*youtube.com/watch*:*: { 

; if the window @YouTube isn't alraedy open, open it and show the time opened
  if %tube != on {
    window @YouTube
    set %tube on
    echo @YouTube ��� Info: YouTube window opened $day $+ , $date $+ , $time
    echo @YouTube .................................................................................................................................................
  }

; this is to deal with queries where $chan is empty
  if ($chan == $null) {
    echo @YouTube 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $+ $network PM $+ 4> 4< $+ $nick $+ 4> $1-
    write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network $chan $+ > < $+ $nick $+ > $1-
  }

; all other messages
  else { 
    echo @YouTube 4< $asctime(mm:dd:yyyy-HH:nn:ss)  $+ 4> 4< $+ $network $chan $+ 4> 4< $+ $nick $+ 4> $1-
    write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network $chan $+ > < $+ $nick $+ > $1-
  }

}

on *:close:@YouTube:{
  set %tube off
}