All pastes #67328 Raw Edit

Untitled

public text v1 · immutable
#67328 ·published 2006-06-19 19:44 UTC
rendered paste body
alias rstitle {
  .remove source.html
  .sockclose rstitle
  .sockopen rstitle www.runescape.com 80
}

ALIAS HTMLStrip {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $replace($remove(%x,&nbsp;),&amp;,&)
  return %x
}

on 1:SOCKOPEN:rstitle:{
  sockwrite -n rstitle GET /lang/en/aff/runescape/index.ws HTTP/1.0
  sockwrite -n rstitle Host: www.runescape.net
  sockwrite -n rstitle Connection: Keep-Alive
  sockwrite -n rstitle $crlf
}

on 1:SOCKREAD:rstitle:{
  .sockread %data
  echo -a $iif(%data == $null,-,%data)
  if (<title> isin %data)  { echo -a $HTMLStrip(%data) }
}