Youtube Profile Info
Platform: mIRC
Published Oct 04, 2011
Updated Oct 04, 2011
made it just for fun to be honest
Command: !youtube <youtube user name>
remove the "<>"
feel free to comment
alias nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,')
return %x
}
On $*:Text:/^(!youtube)/Si:#:{
set %a $2 | set %c $chan | sockopen utube. $+ $r(1,9999) www.youtube.com 80
}
on *:sockopen:utube.*:{
if (!$sockerr) {
sockwrite -nt $sockname GET $+(/user/,%a) HTTP/1.1
sockwrite -nt $sockname Connection: close
sockwrite -nt $sockname Host: $+($sock($sockname).addr,$str($crlf,2))
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | halt }
}
on *:sockread:utube.*:{
if (!$sockerr) {
var %sockreader | sockread %sockreader
if ($regex(%sockreader,/<div class="profile-info-value fn" id="profile_show_first_name">(.+?)</div>/)) msg %c Name: $nohtml($regml(1))
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_viewed_count">(.+?)</div>/)) msg %c Channel Views: $regml(1)
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_total_video_views">(.+?)</div>/)) msg %c Total Upload Views: $regml(1)
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_age">(.+?)</div>/)) msg %c Age: $regml(1)
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_member_since">(.+?)</div>/)) msg %c Joined: $regml(1)
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_last_activity">(.+?)</div>/)) msg %c Latest Activity: $regml(1)
if ($regex(%sockreader,/<div class="profile-info-value" id="profile_show_subscriber_count">(.+?)</div>/)) msg %c Subscribers: $regml(1)
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | halt }
}