made it just for fun to be honest
Command: !youtube
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 }
}
The problem regarding your so-called tip is, you're selling it in a forcible manner, expecting people to take it the way you want it to be. There's nothing wrong with using the generic nohtml alias with regex. He can match one string and not fret about having all the html tags left un-stripped if any.
Dean, toclafane1 has a choice to learn from whomever he wishes that's sensible, compassionate and open to others, not from the one who labels people all sort of names who don't conform to your way of "teachings." You stand by your own belief of what is the right approach to code in MSL, not buying what other people have to offer in reply, and completely disregarding us as if we're against you. If you're gonna bark back at me with your defense, you're just as hypocritical as you appear to be.
Conscious
If someone happens to use an older version than 6.17 they should get a newer version.
totally agree... Jethro said it in past and now he is being hypocrite
toclafane1
Just wondering Dean any need for arguing about how someone codes?
i just give u an advice, and then you just said
toclafane1
Cool
i think you learnt something, but if you dont want, delete it, i dont mind, deleted this post too, and keep your code as they way it is
I know this has been said time after time. $regsubex is an identifier being abused quite commonly in place of a simple while loop.
you're the only guy that abuse of $regex and $regsubex here... if someone post something with while loop, then you post something with $regsubex, if someone post something with $regsubex you post with while loop