Register
tglogo.png
thumbblank.png 0 LIKES

Snippet

Buzzen Profile Info
posted by err0r in Buzzen - 01/07/16
Show buzzen member profile information on join
menu channel {
  $iif($istok(%profreadrooms,#,44),$style(1)) Profile Reader #: { 
    $iif($istok(%profreadrooms,#,44),set %profreadrooms $remtok(%profreadrooms,#,44),set %profreadrooms $addtok(%profreadrooms,#,44)) 
  }
}
on !*:JOIN:#:{ 
  if ((!$istok(%profreadrooms,#,44)) || (%Profileflood > 2) || ($left($nick,1) == ^) || ($left($nick,1) == >)) { halt }
  inc -u2 %Profileflood
  hadd -m mc_temp prof.ck. [ $+ [ $nick ] ] $chan
  .raw PID $nick
}
raw data:*: { 
  if ($2 == PID) { 
    if ($hget(mc_temp,prof.ck. [ $+ [ $3 ] ])) { 
      getbuzzenprofile $3 $4 $hget(mc_temp,prof.ck. [ $+ [ $3 ] ])
      hdel mc_temp prof.ck. [ $+ [ $3 ] ]  
    }
  } 
  halt
}

alias getbuzzenprofile {
  var %ps $rand(1,9999999999999) 
  sockopen -e ckbprof. $+ %ps www.buzzen.com 443 
  sockmark ckbprof. $+ %ps $1 $2 $3
}
on *:sockopen:ckbprof.*: { 
  if ($sockerr) { sockclose $sockname | halt }
  sockwrite -n $sockname GET /mircinfo/profileinfo.php?pid= $+ $gettok($sock($sockname).mark,2,32) HTTP/1.1
  sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
  sockwrite -n $sockname Accept-Encoding: text/html
  sockwrite -n $sockname Host: www.buzzen.com
  sockwrite -n $sockname $crlf
}
on *:sockread:ckbprof.*: {
  if ($sockerr > 0) return
  var %bp
  sockread %bp
  if ($regex(%bp,/Picture: (.*?)<br \/>/)) { set -e %prof_pic $striphtml($regml(1)) }
  if ($regex(%bp,/Nickname: (.*?)<br \/>/)) { set -e %prof_nick $striphtml($regml(1)) }
  if ($regex(%bp,/Firstname: (.*?)<br \/>/)) { set -e %prof_first $striphtml($regml(1)) }
  if ($regex(%bp,/Lastname: (.*?)<br \/>/)) { set -e %prof_last $striphtml($regml(1)) }
  if ($regex(%bp,/City: (.*?)<br \/>/)) { set -e %prof_city $striphtml($regml(1)) }
  if ($regex(%bp,/Country: (.*?)<br \/>/)) { set -e %prof_country $regml(1) }
  if ($regex(%bp,/Age: (.*?)<br \/>/)) { set -e %prof_age $regml(1) }
  if ($regex(%bp,/Gender: (.*?)<br \/>/)) { set -e %prof_gender $regml(1) }
  if ($regex(%bp,/Orientation: (.*?)<br \/>/)) { set -e %prof_sexort $regml(1) }
  if ($regex(%bp,/Marital: (.*?)<br \/>/)) { set -e %prof_marital $regml(1) }
  if ($regex(%bp,/Homepage: (.*?)<br \/>/)) { set -e %prof_homepage $regml(1) }
  if ($regex(%bp,/LastUpdate: (.*?)<br \/>/)) { set -e %prof_update $regml(1) }
  if ($regex(%bp,/Mood: (.*?)<br \/>/)) { set -e %prof_mood $regml(1) }
  if ($regex(%bp,/Views: (.*?)<br \/>/)) { set -e %prof_views $regml(1) }
  if ($regex(%bp,/ENDPROF/)) { 
    tokenize 32 $sock($sockname).mark
    echo $3 [Profile] -------------------------------------------------------------------------------------------
    echo $3  $+ $1 [Name: %prof_first %prof_last $+ ] [Gender: %prof_gender $+ ] [Age: %prof_age $+ ] [From: %prof_city %prof_country $+ ] [Sexual Orientation: %prof_sexort $+ ] [Status: %prof_marital $+ ] [Mood: %prof_mood $+ ] [Views: %prof_views $+ ] [Updated: %prof_update $+ ] 
    echo $3 -----------------------------------------------------------------------------------------------------
    unset %prof_*
    sockclose $sockname
  }
}


2 Comments
You must be logged in to comment.
Paige - Monday, 25 January, 2016
Isn't working for me , doesn't show profile details of anyone who joins rooms, when switched on or otherwise.
err0r - Monday, 25 January, 2016
I just tested it in a new empty mirc. works fine. if you are using this in something like moschino you will probably have to change the raw data pid return