All pastes #241433 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-11-06 05:02 UTC
rendered paste body
alias -l htmlfree {
  ; It's local because it won't be used by the command line, only this file.
  ; Local aliases avoid conflicting names.
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
alias stats sockopen hiscore hiscore.runescape.com 80 | var %user $1
on *:sockopen:hiscore: { 
  sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ %user HTTP/1.1 
  ; This is telling the socket to connect to the specific page, using "GET".
  sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
  ; This states the host once again.
}
on *:sockread:hiscore:{
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (<td align="right">*</td><br> iswm %temptext) {
      echo -a -
      echo -a $htmlfree(%temptext)
      msg $active $htmlfree(%temptext)    
    }
  }
}