All pastes #58584 Raw Edit

Stuff

public text v1 · immutable
#58584 ·published 2006-05-24 07:26 UTC
rendered paste body
alias wotrodb {
  if $1 {
    set %wotro.search $1-
    sockopen wotrodb wotro.kicks-ass.org 80
  }
}

alias -l wotro.die { sockclose wotrodb | unset %wotro.* }

alias -l wotro.address { return $+(http://fidsah.kicks-ass.org/php/mob.php?search=,$replace($1-,$chr(32),+),&mIRC=1) }

on *:sockopen:wotrodb:{ 
  sockwrite -n $sockname GET $wotro.address(%wotro.search) HTTP/1.1 
  sockwrite -n $sockname Host: fidsah.kicks-ass.org $+ $crlf $+ $crlf
}

on *:sockread:wotrodb:{
  ;this will trigger when the website cant be reached 
  if $sockerr { echo -s Socket Error: $sockerr | halt }
  else {
    .var %wotro.raw
    ;    sockread the result, line by line into %wotro.raw
    sockread %wotro.raw
    ;    uncomment the following line to see the entire receieved data, for debugging.
    if %wotro.raw != $null { echo -s %wotro.raw }

    /*
    This is where you add your code
    */

  }
  if </html> isin %wotro.raw { 
    wotro.die 
    halt 
  }
}