Youtube Profile Info

By Stewie1k94 on Oct 04, 2011

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,&nbsp;,&#39;) 
  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 }
}

Comments

Sign in to comment.
alabama   -  Oct 08, 2011

he watches anime cuz he cant get no 3d girl

 Respond  
alabama   -  Oct 08, 2011

he is prob cutting his wrists

 Respond  
Stewie1k94   -  Oct 08, 2011

haha

 Respond  
alabama   -  Oct 07, 2011

anime is for virgins LOL

 Respond  
Stewie1k94   -  Oct 07, 2011

but then again, you and your gang attack again Nobody is attacking you, they were just saying :D

 Respond  
Jethro   -  Oct 07, 2011

alabama, I know I wasn't lying about Dean. I wish people knew then what I know now...

 Respond  
alabama   -  Oct 06, 2011

dean, ur weird, ur a anime noob

 Respond  
Jethro   -  Oct 06, 2011

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.

 Respond  
_Dean_   -  Oct 06, 2011

i just said that he doesnt need to use $nohtml alias, and he can use the $regsubex to get an efficient result
to replace &#N into characters =)
but then again, you and your gang attack again

 Respond  
Jethro   -  Oct 06, 2011

If you're going to give someone a tip, be sure to give the correct tip, not a completely rewrite of your own that winds up misrepresenting the snippet -- like what happened to your "tip" under xdesoto's snippet thread. It was an utter fallacy.

 Respond  
_Dean_   -  Oct 06, 2011

to be honest the reason i am posting the snippets i make is so i can see other peoples suggestions and help, so i can learn more about scripting.

so why did you say, that im "arguing about how someone codes" when i just gave you a tip?

 Respond  
ulquiorra4   -  Oct 06, 2011

nice ^_^

 Respond  
Stewie1k94   -  Oct 06, 2011

To be honest I'm learning from everyones posts, maybe some more than others, to be honest the reason i am posting the snippets i make is so i can see other peoples suggestions and help, so i can learn more about scripting.

 Respond  
Jethro   -  Oct 06, 2011

It's written on your forehead. You gotta smack it.

 Respond  
alabama   -  Oct 06, 2011

dean, ur weird, ur a anime noob

 Respond  
_Dean_   -  Oct 05, 2011

where is the dis-like button?

 Respond  
Jethro   -  Oct 05, 2011

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.

 Respond  
  -  Oct 05, 2011

Jethro has a valid point that coding things backwards compatible is a good idea, tho yes People should try to always be up to date, It shows much more skill and effort when some one takes the time to code something that will work for everyone.
Really guys do we have to have this on every post?

 Respond  
_Dean_   -  Oct 05, 2011

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

 Respond  
Jethro   -  Oct 05, 2011

Be that as it may, jaytea. Some people do abuse regsubex for things that can be done with a regular while loop. What Mr. Dean has posted above was uncalled for and irrelevant to the point I was making.

 Respond  
jaytea   -  Oct 05, 2011

i don't see that as an inappropriate use of $regsubex(). the alternative mSL is not that simple.

 Respond  
Stewie1k94   -  Oct 05, 2011

Rofl

 Respond  
Jethro   -  Oct 05, 2011

toclafane, you can delete the "flaming" post if you wish to keep your thread under control. There is a difference between using $regex and the later-introduced identifier $regsubex. Please get that in your head rather than act like a troll.

 Respond  
Stewie1k94   -  Oct 05, 2011

Just wondering Dean any need for arguing about how someone codes?

 Respond  
Conscious   -  Oct 05, 2011

If someone happens to use an older version than 6.17 they should get a newer version.

 Respond  
_Dean_   -  Oct 05, 2011

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

 Respond  
Stewie1k94   -  Oct 05, 2011

i use version 7.19

 Respond  
Jethro   -  Oct 05, 2011

I know this has been said time after time. $regsubex is an identifier being abused quite commonly in place of a simple while loop. It's not a good practice to use it everywhere. Furthermore, those who happen to use older versions below 6.17 will get an error.

 Respond  
Stewie1k94   -  Oct 05, 2011

Cool

 Respond  
_Dean_   -  Oct 05, 2011

toclafane1 you can use

alias char_r { return $regsubex($$1,/&\043(\d+)/g,$chr(\1)) }

and then use this

$char_r($regml(1))

so it will turn all &#N in characters

 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.