In case you guys were wondering if I pulled it off or not... I did. I spent days belaboring over this with another friend and here is the product:
It catches on *youtube.com/watch?v=* . It activates a @window to paste results into and writes to a youtube.txt file for future reference in case you close the @window.
The results include the title of the video, the description (be it long or short, and by that i mean the fundamental difference in html on youtube videos for long/short descriptions), and how many stars its got, as well as the original comment that the url was mentioned in, in addition to network basics like : what time/day, what network it came from, what channel, and which nick said it.
You can change the disgusting colors I have (they only apply to my mIRC's look, sorry) in order to accomodate yourself
PLEASE leave your comments and let me know how it is! And if you have any additions to recommend, please let me know!
on *:text:*youtube.com/watch?v=*:*:{
%rating = 0
%entry = $1-
if %tube != on {
window @YouTube
set %tube on
echo @YouTube •›› Info: YouTube window opened $day $+ , $date $+ , $time
}
if (http:// isin $1-) %ytpath = / $+ $gettok($gettok($1-,3,47),1,38)
else %ytpath = / $+ $gettok($gettok($1-,2,47),1,38)
%ytnick = $nick
%ytchan = $chan
sockclose yt
sockopen yt youtube.com 80
}
on *:close:@YouTube:{
set %tube off
}
on *:sockopen:yt:{
if ($sockerr) {
echo -a $chr(91) $+ $time $+ $chr(93) YouTube: socket error
if (%ytchan) {
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube ERROR: < $+ $date $+ > < $+ $time $+ > < $+ $network %ytchan $+ > < $+ %ytnick $+ > %entry
write yterror.txt < $+ $date $+ > < $+ $time $+ > < $+ $network %ytchan $+ > < $+ %ytnick $+ > %entry
}
if (%ytchan == $null && %ytnick != $null) {
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube ERROR: < $+ $date $+ > < $+ $time $+ > < $+ $network PM $+ > < $+ %ytnick $+ > %entry
write yterror.txt < $+ $date $+ > < $+ $time $+ > < $+ $network PM $+ > < $+ %ytnick $+ > %entry
}
halt
}
sockwrite -n $sockname GET %ytpath HTTP/1.1
sockwrite -n $sockname Host: youtube.com
sockwrite -n $sockname $crlf
}
on *:sockread:yt: {
:read
sockread -f %ytread
if (<img class="rating" src="/img/star.gif" isin %ytread) {
inc %rating
}
if (<title> isin %ytread) %title = $remove(%ytread, ,<title>YouTube - ,</title>)
if (%found) { unset %found | %desc_be = $remove(%ytread, ) }
if (<span id="vidDescBegin"> isin %ytread) %found = k
if (<span id="vidDescRemain"> isin %ytread) %desc_re = $replace($remove(%ytread, ,<span id="vidDescRemain">,</span>),<br/>,$chr(32))
if (<span class="smallLabel">Category </span> isin %ytread) %done = k
if (%done) {
sockclose yt
unset %done
:title
if (%ytchan) {
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube 4-----> 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $network %ytchan $+ 4> 4< $+ %ytnick $+ 4>
echo @YouTube %entry
echo @YouTube Title: %title Rating: %rating stars
write youtube.txt .....................................................................................................................................................................................................................................................................
write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network %ytchan $+ > < $+ %ytnick $+ > %entry
write youtube.txt Title: %title Rating: %rating stars
}
if (%ytchan == $null && %ytnick != $null) {
echo @YouTube ...................................................................................................................................................................................................................................................................................................
echo @YouTube 4-----> 4< $asctime(mm:dd:yyyy-HH:nn:ss) $+ 4> 4< $network PM $+ 4> 4< $+ %ytnick $+ 4>
echo @YouTube %entry
echo @YouTube Title: %title Rating: %rating stars
write youtube.txt .....................................................................................................................................................................................................................................................................
write youtube.txt < $+ $date $+ > < $+ $time $+ > < $+ $network PM $+ > < $+ %ytnick $+ > %entry
write youtube.txt Title: %title Rating: %rating stars
}
:desc
if (%desc_re) {
echo @YouTube Description: %desc_re
write youtube.txt Description: %desc_re
}
else {
echo @YouTube Description: %desc_be
write youtube.txt Description: %desc_be
}
unset %entry
unset %ytpath
unset %ytnick
unset %ytchan
unset %title
unset %ytread
unset %desc_be
unset %desc_re
unset %rating
}
if ($sockbr) goto read
}