[23:26:40] 09@j_bot [YouTube] Title: [HD] Cortland Finnegan and Andre Johnson Fight! (ALL CAMERA ANGLES)! <> Comments: 2,168 <> Favorites: 903 <> Total Views: 446,048 <> Ratings: 646 <> Likes: 620 <> Dislikes: 26
Bielie , here http://www.hawkee.com/phpBB2/viewtopic.php?t=22062&highlight=youtube , Jethro_ come up with a solution :) ( youtube likes to change everything from time to time :) )
sorry PsyTrance , i can't help with that one , i tried , but seems the duration of the video is not in the html source code ( from where the script reads to search everything , go to any video and in your browser check the source code , search the time and you will see is not there ; all the durations i can see are from the related videos but no the playing one :( ) , i tried with several videos , seems like the duration is embedded in some way in the flash player and not in the html itself , maybe someone else with more experience in scripting can help us with that :)
PS : i add something i found :) i replaced
title="(.+)"> )) set %youtuberating $regml(1)
with
title="(.+)">)) set %youtuberating $regml(1)
only deleted the space after title="(.+)"> , in some videos was not working right
exactly , for some reason ( kind of noob to this still so idk why , actually this one was my firs or second script using sockets :) ) , the $chan doesnt work within the sockclose event , so you need to use the actual name of the channel ( #blabla , if you have only 1 ) or a variable like lucius said :)
UPDATED 2 DECEMBER 2010
here http://www.hawkee.com/phpBB2/viewtopic.php?t=22062&highlight=youtube , Jethro_ come up with a solution :)
this one works ( USED TO , i keep it here just in case) ( just my small adaptation of the original here ) :)
; ********** 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))
}
}
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,<meta name="title" content="(.+)">)) set %youtubetitle $regml(1)
elseif ($regex(%x,<strong class="watch-view-count">(.+)</strong><br>)) set %youtubeviews $regml(1)
elseif ($regex(%x,<span class="watch-video-date">(.+)</span>)) set %youtubedate $regml(1)
elseif ($regex(%x,<div class="action-bar-ratings-stats yt-uix-tooltip" title="(.+)"> )) set %youtuberating $regml(1)
elseif ($regex(%x,<a id="watch-username" class="inline-block" href="/user/(.+)">)) set %youtubeuser $regml(1)
}
on *:sockclose:youtube: {
msg #CHANNEL $chr(91) $+ YouTube $+ $chr(93) " $+ %youtubetitle $+ " --- %youtubeviews views $&
( %youtuberating ) uploaded %youtubedate by %youtubeuser ---
unset %youtube*
}
; ************************************************
[14:52:16] http://www.youtube.com/watch?v=wnNhxqD1FTA
[14:52:18] [YouTube] "That's the Thing about Football 2008" --- 14,602 views ( 33 likes, 1 dislikes ) uploaded by TheSwert ---
just change the name of your channel in
on *:sockclose:youtube