Jethro commented on a Page, Random Slogans  -  Dec 04, 2010

Here is mine based upon Napa's original with a different site that supports both GET and POST:

on $*:text:/^@slogan\s(.+)/iS:#:{
  if !%f { inc -u5 %f | if $sock(slogan) { sockclose slogan }
    sockopen slogan thesurrealist.co.uk 80
    sockmark slogan $replace($regml(1),$chr(32),+) msg # [04Random Slogan]
  }
}
on *:sockopen:slogan:{
  var %sloggen $+(?word=,$token($sock(slogan).mark,1,32))
  sockwrite -nt slogan POST /slogan.cgi HTTP/1.1
  sockwrite -nt slogan Host: $sock(slogan).addr $+ $str($crlf,2)
  sockwrite -nt slogan Content-Type: application/x-www-form-urlencoded
  sockwrite -nt slogan Content-Length: $len(%sloggen)
}
on *:sockread:slogan:{
  var %slogan | sockread %slogan
  if ($regex(%slogan,/<a href="\/slogan.cgi\?word\="\sclass\="h1a">(.+)</a>/)) { 
    $token($sock(slogan).mark,2-,32) $regsubex($regml(1),/(<b>.+<\/b>)/,$&
      $replace($token($sock(slogan).mark,1,32),+,$chr(32))) | sockclose slogan 
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.