All pastes #236492 Raw Edit

Stuff

public text v1 · immutable
·published 2006-11-03 20:46 UTC
rendered paste body
alias bash {
  sockclose bash
  sockopen bash www.bash.org 80
}
on *:sockopen:bash: {
  sockwrite -n $sockname GET /?random50
  sockwrite -n $sockname Host: www.bash.org
  sockwrite -n $sockname Keep-Alive: 200
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname
}
on *:sockread:bash: {
  var %bash
  sockread %bash
  while $sockbr {
    if ($regex(%bash,/href="(\?\d+)"/)) {
      sockclose bash
      set %bashnum $+(/,$regml(1))
      rebash
    }
    sockread %bash
  }
}
alias rebash {
  sockclose rebash
  sockopen rebash www.bash.org 80
}
on *:sockopen:rebash: {
  sockwrite -n $sockname GET %bashnum
  sockwrite -n $sockname Host: www.bash.org
  sockwrite -n $sockname Keep-Alive: 200
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname
}
on *:sockread:rebash: {
  var %rebash
  sockread %rebash
  while $sockbr {
    if ($regex($1-,/<p class="qt">(.+)/)) {
      set %Quoter on
    }
    if (%Quoter == on) {
      echo -a %rebash
      if (*</td>* iswm $1-) { 
        echo -a :o
        unset %Quoter
        unset %bashnum
        sockclose rebash
      }
    }
    sockread %rebash
  }
}