Jethro commented on a Page, Random Thought  -  Jun 10, 2011

Extremity, they have a webpage for mobile, which is completely random. Here is my take on using it:

on *:text:$($iif(!rt = $strip($1),$1)):*:{
  if !%fc { inc -u4 %fc | $rt }
}
on *:sockopen:rt:{
  tokenize 94 $sock(rt).mark
  if !$sockerr {
    $1 GET /gadgets/mobile/index.php HTTP/1.1
    $1 Connection: close 
    $1 HOST: $+($sock(rt).addr,$str($crlf,2))
  }
  else { $3 Problem Connecting to $sock(rt).addr }
}
on *:sockclose:rt:{
  tokenize 94 $sock(rt).mark
  $3 Random Thought: $iif($hget(rt,3).item $hget(rt,3).data = $&
    a random thought:,I'm currently thoughtless; try me again in 4 secs...,$v1)
}
alias rt {
  if ($sock(rt)) sockclose rt 
  sockopen rt randomthoughts.ws 80
  sockmark rt $+(sockwrite -nt rt,^,scon -r hadd -mu4 rt,^,$&
    $+ $iif($isid,.msg $iif(#,#,$nick),echo -a))
}
on *:sockread:rt:{
  if !$sockerr {
    var %rt, %t /(.*)(<\/b>|<br\/>)/i
    sockread %rt | if $regex(%rt,%t) {
      tokenize 62 $regml(1)
      $gettok($sock(rt).mark,2,94) $!remove( $* ,<b style="color:red;",<b)
    }
  }
  else {
    tokenize 94 $sock(rt).mark 
    $3 Problem Reading $sock(rt).addr
  }
}
!rt Random Thought: Is this your life? What do you choose to make it? Sex with a random girl/guy. Drugs and alcohol on the weekends. Life is so much more.... What will you choose to make it. When will you trust God? !rt Random Thought: I'm currently thoughtless; try me again... !rt Random Thought: I wonder if when my cat runs across my face at night scratching me
 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.