M[n]M commented on a Page, Youtube URL Catcher  -  Jun 24, 2008

dude its not working :[ :\ :/
but i changed it :P
TO:

on *:text:*:#: {
  if (*youtube.com/watch?* iswm $1-) {
    %yt.rating = 0
    %yt.entry = $1-
    set %yt.chan $chan    
    if ($window(@YouTube) == $null) {
      msg %yt.chan Tittle: %yt.title - Favorite: $remove(%yt.favorited,<span class=\"watch-stat\">,</span>) - Ratings:4 $remove(%yt.numratings,<div id=\"ratingWrapper\"><div,class=\"floatL\",onclick=\"urchinTracker(\'/Events/VideoWatch/Rated\');\"><div,id=\"ratingStars\",class=\"floatL\"><img,class=\"ratingL,ratingL-4.5\",alt=\"4.57788461538\",src=\"http://s.ytimg.com/yt/img/pixel-vfl73.gif\",/><div,id=\"ratingMessage\">,><img,<div,id=\"hoverMessage\",style=\"width:100%\",class=\"hid\"><a href=\"/login?next=/watch%3Fv%3DH9mRL8C9MCM\">Sign,in</a>,to,rate)    
    }
    if (http:// isin $1-) { %yt.path = / $+ $gettok($gettok($gettok($1-,3,47),1,38),1,32) }
    else { %yt.path = / $+ $gettok($gettok($gettok($1-,2,47),1,38),1,32) }
    %yt.nick = $nick
    %yt.chan = $chan
    %yt.surl = $remove(%yt.path,/watch?v=)
    sockclose yt
    sockopen yt youtube.com 80
  }
}

on *:sockopen:yt:{
  if ($sockerr) {
    ;    echo -a $chr(91) $+ $time $+ $chr(93) YouTube: socket error 
    if (%yt.chan) {
      msg %yt.chan $str(.,282)
      msg %yt.chan ERROR: $+($chr(3),04,<,$chr(15),$date,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$time,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$network %yt.chan,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),%yt.nick,$chr(3),04>,$chr(15)) %yt.entry
      write yterror.txt < $+ $date $+ > < $+ $time $+ > < $+ $network %yt.chan $+ > < $+ %yt.nick $+ > %yt.entry
    }
    if (%yt.chan == $null && %yt.nick != $null) {
      msg %yt.chan $str(.,282)
      msg %yt.chan ERROR: $+($chr(3),04,<,$chr(15),$date,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$time,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$network PM,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),%yt.nick,$chr(3),04>,$chr(15)) %yt.entry
      write yterror.txt < $+ $date $+ > < $+ $time $+ > < $+ $network PM $+ > < $+ %yt.nick $+ > %yt.entry
    }
    halt
  }
  sockwrite -n $sockname GET %yt.path HTTP/1.1
  sockwrite -n $sockname Host: youtube.com
  sockwrite -n $sockname $crlf
}

on *:sockread:yt: {
  :read
  sockread -f %yt.read

  if (Ratings have been disabled for this video isin %yt.read) { set %yt.ratingsdisabled no }
  if (Adding comments has been disabled for this video isin %yt.read) { set %yt.commentsdisabled no }
  if (icn_star_full_19x20png isin %yt.read) { %yt.rating = $count(%yt.read,star_full) }

  if (ratings</span> isin %yt.read) { %yt.numratings = $remove(%yt.read,    ,<div id=\"ratingMessage\" style=\"float:right\">,<div id=\"defaultRatingMessage\">,<span class=\"smallText\">, ratings</span>,</div>) }
  if (<span class=\"viewCount\"> isin %yt.read) { %yt.views = $remove(%yt.read, ,<span class=\"viewCount\">,</span>) }
  if (<span class=\"lightLabel\">Comments:</span> isin %yt.read) { %yt.comments = $remove(%yt.read, , ,<span class=\"lightLabel\">Comments:</span> ,<a href=\"/comment_servlet?,&all_comments,all_comments,&v=,&amp;,v=,%yt.surl,\">,</a>) }
  if (<span class=\"lightLabel\">Favorited:</span> isin %yt.read) { %yt.favorited = $remove(%yt.read,   ,<span class=\"lightLabel\">Favorited:</span> , times) }
  if (<meta name=\"title\" content=\" isin %yt.read) { %yt.title = $replace($remove(%yt.read,   ,<meta name=\"title\" content=\",\">),<br/>,$chr(32),&amp;,&,&quot;,\") }
  if (<meta name=\"description\" content=\" isin %yt.read) { %yt.desc_re = $replace($remove(%yt.read,   ,<meta name=\"description\" content=\",\">),<br/>,$chr(32),&amp;,&,&quot;,\") }

  ;if (<title> isin %yt.read) { %yt.title = $remove(%yt.read,   ,<title>YouTube - ,</title>) }
  ;if (%yt.found) { unset %yt.found | %yt.desc_be = $replace($remove(%yt.read,  ),&amp;,&) }
  ;if (<span id=\"vidDescBegin\"> isin %yt.read) { %yt.found = k }
  ;if (<span id=\"vidDescRemain\"> isin %yt.read) { %yt.desc_re = $replace($remove(%yt.read,    ,<span id=\"vidDescRemain\">,</span>),<br/>,$chr(32),&amp;,&,&quot;,\") }

  if (<span class=\"smallLabel\">Category:&nbsp;</span> isin %yt.read) { %yt.done = k }

  if (%yt.done) {
    sockclose yt
    unset %yt.done

    if ($read(youtube.txt,w,* $+ %yt.path $+ *) != $null) { %yt.record = noop }
    else { %yt.record = write }

    %yt.num.rating = $remove(%yt.rating,$chr(44),$chr(32))
    %yt.num.views = $remove(%yt.views,$chr(44),$chr(32))
    %yt.num.numratings = $remove(%yt.numratings,$chr(44),$chr(32))
    %yt.num.comments = $remove(%yt.comments,$chr(44),$chr(32))
    %yt.num.favorited = $remove(%yt.favorited,$chr(44),$chr(32))

    %yt.red.start = 4
    %yt.red.stop = 
    %yt.maroon.start = 5
    %yt.maroon.stop = 

    ;viral or not
    if (%yt.num.views >= 100000) {
      %yt.boldstart.views = %yt.red.start
      %yt.boldstop.views = %yt.red.stop
      if (%yt.num.rating >= 4) { %yt.boldstart.rating = %yt.red.start | %yt.boldstop.rating = %yt.red.stop }
      else { %yt.boldstart.rating = $null | %yt.boldstop.rating = $null }
    }
    elseif (%yt.num.views >= 15000 && %yt.num.views < 100000) { %yt.boldstart.views = %yt.maroon.start | %yt.boldstop.views = %yt.maroon.stop }
    else { %yt.boldstart.views = $null | %yt.boldstop.views = $null }
    if (%yt.num.numratings >= 350) { %yt.boldstart.numratings = %yt.red.start | %yt.boldstop.numratings = %yt.red.stop }
    else { %yt.boldstart.numratings = $null | %yt.boldstop.numratings = $null }
    if (%yt.num.comments >= 1000) { %yt.boldstart.comments = %yt.red.start | %yt.boldstop.comments = %yt.red.stop }
    else { %yt.boldstart.comments = $null | %yt.boldstop.comments = $null }
    if (%yt.num.favorited >= 700) { %yt.boldstart.favorited = %yt.red.start | %yt.boldstop.favorited = %yt.red.stop }
    else { %yt.boldstart.favorited = $null | %yt.boldstop.favorited = $null }

    :title
    if (%yt.chan) { %yt.chanq = %yt.chan }
    elseif (%yt.chan == $null && %yt.nick != $null) { %yt.chanq = PM }

    msg %yt.chan $str(.,282)
    msg %yt.chan 4 $+($chr(3),04,<,$chr(15),$date,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$time,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),$network %yt.chanq,$chr(3),04>,$chr(15)) $+($chr(3),04,<,$chr(15),%yt.nick,$chr(3),04>,$chr(15)) %yt.entry
    msg %yt.chan Title: %yt.title

    %yt.record youtube.txt $str(.,261)
    %yt.record youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network %yt.chanq $+ > < $+ %yt.nick $+ > %yt.entry
    %yt.record youtube.txt Title: %yt.title
  }
}
 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.