BeachCreeps Search

By FordLawnmower on Dec 01, 2010

Searches Beachcreeps.com for funny images/stories.
This script was requested by bourneident.
Credit for the idea goes to bourneident.

Using the script::

  • Copy this code, paste it to a new remote and save it with a unique file name.
  • Type +beachcreep in the channels you want to run the script (requires ops)
  • Notice trigger: !beachcreep search words. (notices results to user)
  • Message trigger: @beachcreep search words. (voices or higher. Messages the

channel)

  • There is a master on/off switch on the right click menu.
  • See the comments at the top of the script for color/logo changes.
  • Screen Shot:
    Image
;BeachCreeps search script by Ford_Lawnmower irc.geekshed.net #Script-Help
;Script Idea and Request by bourneident.
;;;;;Edit the 3 alias's below to adjust the logo, text color and link color ;;;;;;;
alias -l w.logo return 04B07e06a09c13h04C07r07e06e09p13s06 
alias -l w.textcolor return 04
alias -l w.linkcolor return 
;;;;;End of edit area;;;;;;;;
menu Channel,Status {
  .$iif($group(#BeachCreep) == On,$style(1)) BeachCreep Trigger
  ..$iif($group(#BeachCreep) == On,$style(2)) On: .enable #BeachCreep
  ..$iif($group(#BeachCreep) == Off,$style(2)) Off: .disable #BeachCreep
}
#BeachCreep on
On $*:Text:/^(\+|-|!|@)BeachCreep[s]?.*/Si:#: {
  var %action $regml(1)
  if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
    if (%action == +) {
      if ($istok(%BeachCreepChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the BeachCreep script }
      else { 
        .enable #BeachCreep
        Set %BeachCreepChanList $addtok(%BeachCreepChanList,$+($network,$chan),32)
        .msg $chan $nick has activated the BeachCreep script for $chan .
      }
    }
    else {
      if (!$istok(%BeachCreepChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the BeachCreep script }
      else { 
        Set %BeachCreepChanList $remtok(%BeachCreepChanList,$+($network,$chan),1,32)
        .msg $chan $nick has deactivated the BeachCreep script for $chan . 
      }
    }
  }
  elseif (!$timer($+(BeachCreep,$network,$nick))) && ($istok(%BeachCreepChanList,$+($network,$chan),32)) {
    .timer $+ $+(BeachCreep,$network,$nick) 1 6 noop
    var %method $iif(%action == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%|\+)/),.msg $chan,.notice $nick))
    GetBeachCreep %method $2-
  }
}
#BeachCreep end
alias BeachCreep { GetBeachCreep echo -a $1- }
alias -l GetBeachCreep {
  $1-2 Searching........
  var %sockname $+(BeachCreep,$network,$2,$ticks)
  sockopen %sockname www.beachcreeps.com 80
  sockmark %sockname $1-2 $+(/?s=,$replace($strip($3-),$chr(32),+)) 0
}
On *:sockopen:BeachCreep*: {
  if (!$sockerr) {
    sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
    sockwrite -n $sockname Host: www.beachcreeps.com
    sockwrite -n $sockname $crlf
  }
  else { sockclose $sockname | return }
}
On *:sockread:BeachCreep*: {
  if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
  else {
    var %BeachCreep | sockread %BeachCreep
    if ($regex(found,%BeachCreep,/<h2><a href="([^"]*)" rel="bookmark" title="Permanent Link to ([^"<]*)">/i)) {
      put $gettok($sock($sockname).mark,1-2,32) $w.logo $w.textcolor $utf8fix($regml(found,2)) $w.linkcolor $regml(found,1)
    }
    elseif (<p>No posts found.</p> isin %BeachCreep) {
      put $gettok($sock($sockname).mark,1-2,32) $w.logo $w.textcolor Nothing found! Please refine your search and try again!
      sockclose $sockname
    }
    elseif (</html> isin %BeachCreep) sockclose $sockname
  }
}
alias -l Put {
  if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text  | return }
  tokenize 32 $regsubex($1-,/([$\|%\[\]\}\{][^\s]*)/g,$+($chr(2),$chr(2),\t))
  var %tokens $0, %Tstart 3, %Dtimer 1500
  if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }  
  while ($len($($+($,%Tstart,-,%tokens),2)) > 430) {
    dec %tokens
    if ($len($($+($,%Tstart,-,%tokens),2)) <= 430) {
      .timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
      inc %Dtimer 1500
      %Tstart = $calc(%tokens + 1)
      %tokens = $0
    }
  }
  .timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
  .timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop 
}
alias -l utf8fix return $replace($regsubex($1-,/&#([\d]{2,4});/g,$utf8(\t)),&amp;,&)
alias -l UTF8 {
  if ($version >= 7) return $chr($1)
  else {
    var %x $base($1,10,2),%y $len(%x)
    if ($1 < 161) { return $chr($1) }
    elseif (%y < 12) { return $+($shift(11000000,$left(%x,-6)),$shift(10000000,$right(%x,6))) }
    elseif (%y < 17) { return $+($shift(11100000,$left(%x,-12)),$shift(10000000,$mid(%x,-12,6)),$shift(10000000,$right(%x,6))) }
    elseif (%y < 22) {
      return $+($shift(11110000,$left(%x,-18)),$shift(10000000,$mid(%x,$iif(%y < 18,$+(-,%y),-18),6)),$shift(10000000,$mid(%x,-12,6)),$shift(10000000,$right(%x,6)))
    }
  }
}
alias -l shift {
  if ($2) { return $chr($base($+($left($1,$+(-,$len($2))),$2),2,10)) }
  else { return $chr($base($1,2,10)) }
}

Comments

Sign in to comment.
dma   -  Dec 10, 2015

does not work anymore in 2015

 Respond  
RIcko   -  Jun 26, 2012

I reloaded the script few times and it worked, thank you for the reply though, +like.

 Respond  
FordLawnmower   -  Jun 26, 2012

I can find no issues with this script:

[14:08:13] <@Ford_Lawnmower> +beachcreeps
[14:08:13] Ford_Lawnmower has activated the BeachCreep script for #FordIRC .
[14:08:24] <@Ford_Lawnmower> @beachcreeps dog
[14:08:24] Searching........
[14:08:26] BeachCreeps Give a Dog a Bone http://www.beachcreeps.com/give-a-dog-a-bone-2/
[14:08:27] BeachCreeps The Night Shift http://www.beachcreeps.com/the-night-shift/
[14:08:28] BeachCreeps Babes of the Day: ButtherFace http://www.beachcreeps.com/buttherface/
[14:08:29] BeachCreeps The Batman http://www.beachcreeps.com/the-batman/

 Respond  
RIcko   -  Jun 26, 2012

Good job Ford, but seems that the link is broken, it needs a simple update :)

 Respond  
Dark|   -  Dec 03, 2010

i think i found napa in one of the searches xD loljk

 Respond  
napa182   -  Dec 03, 2010

funny snippet Ford 8/10 +like

 Respond  
Dark|   -  Dec 01, 2010

lolololol
Nice once again :)

 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.