All pastes #97753 Raw Edit

Someone

public text v1 · immutable
#97753 ·published 2006-07-24 01:23 UTC
rendered paste body
/sockopen digg digg.com 80
ON *:sockopen:digg: {
  sockwrite -n $sockname GET /rss/index.xml HTTP/1.1
  sockwrite -n $sockname HOST: digg.com $+ $crlf $+ $crlf
}
On *:sockread:digg {
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    inc %z 1
    if ($z < 6 ) && ( %z < 1 ) {
      var %temptext
      sockread %temptext
      if (<title>*</title> iswm %temptext ) { 
        set %title $+ %z $htmlfree(%temptext)
        echo works
      }
    }
  }
}
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
}