Top

Hawkee.com snippet searcher and "ripper"


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  10.0 (of 1 scores)
Date Added  Sep 27, 2009
Last Updated  Sep 29, 2009
Tags  dialog  download  hawkee  mirc  msl  rip  ripz  search  socket 

Introduction

there are quite a few snippets on here that search for snippets, but none that actually download and load the code.and that's what this does

paste code in remotes(alt+r) and load it, it will make a directory called Ripz, which is where all the ripped codes will be put
Part I
once you've done that type /rip [-l] snippet number
where the -l switch tells it to load the code once its finished downloading it and snippet number is the number of the snippet e.g., 6749 is the snippet number of http://www.hawkee.com/snippet/6749/
ex:
Code:
/rip -l 6749
will download the code and load it
Code:
/rip 6749
will jsut download the code
this also adds the original authors name and the name of the snippet to the file
Part II
after loading this snippet right click anywhere in the channel/status window or type /shawk
a dialog will appear, choose the platform you wish to search for and type in some text to search for and then click search.
it will then search hawkee.com and return info about the script that you select.
you can also click "Rip this script" to "rip" the code using the first part of this snippet

Grab the Code

on *:load:if (!$isdir(Ripz)) mkdir Ripz
alias rip {
  if ($regex($1-,/(-l\W)?(\d*))) {
    sockopen ripz www.hawkee.com 80
    if ($hget(Ripz)) hfree $v1
    hadd -m Ripz snippet $regml($iif($regml(2),2,1))
    hadd Ripz load $iif($regml(2),$true,$false)
  }
  else echo $color(info) -a * Invalid parameters: /rip [-l] snippet number
}
on *:sockopen:ripz: {
  sockwrite -n $sockname GET $+(/snippet/,$hget(ripz,snippet),/) HTTP/1.1
  sockwrite -n $sockname HOST: www.hawkee.com $+ $crlf $+ $crlf
}
on *:sockread:ripz: {
  var %ripz | sockread %ripz
  if ($regex(%ripz,/Snippet does not exist./i)) { echo -a * Error: %ripz | sockclose $sockname | .hfree Ripz }
  elseif ($regex(%ripz,/<title>(.*)-.*</title>)) {
    hadd -m Ripz Name $remove($htmlfree($regml(1)),.,$chr(44))
    if ($isfile($ripz.loc)) write -c $ripz.loc
  }
  elseif ($regex(%ripz,/<span style="color: #777; font-size: 11px;">(.*)</span>)) {
    if ($regml(1) != mIRC Code) { sockclose $sockname | .hfree Ripz | echo -a Error: Snippet not written in MSL }
  }
  elseif ($regex(%ripz,/<div class="breadcrumb">)) {
    sockread %ripz
    hadd -m Ripz Author $gettok($gettok($htmlfree(%ripz),-2,62),1,39)
  }
  elseif ($regex(%ripz,/<pre class="mirc" style="font-family: Lucida Console. Monaco. Courier;">) && !$sock($Sockname).mark) {
    sockmark $sockname $true
    ripz.write ; $+ $hget(Ripz,name) by: $hget(Ripz,Author)
    ripz.write $htmlfree(%ripz)
  }
  elseif ($sock($sockname).mark && $htmlfree(%ripz)) { 
    ripz.write $v1 
    if ($regex(%ripz,(\W?(</span>\W|&nbsp;)?</pre>|</div)$)) rip.finish
  }
  elseif (</form> isin %ripz && $sock($sockname).mark) { rip.finish }
}
alias -l ripz.write write $ripz.loc $1-
alias -l ripz.loc return $qt($+($mircdirRipz\,$hget(Ripz,name),.mrc))
alias -l rip.finish {
  if ($sock(ripz)) sockclose $v1
  if ($isfile($ripz.loc) && $hget(Ripz,load)) { .load -rs $ripz.loc }
  if ($hget(Ripz)) .hfree $v1
  echo -a Rip complete!
}
menu channel,status {
  Hawkee.com Snippet Searcher:shawk
}
alias shawk dialog $+(-,$iif($dialog(shawk),-v,-md shawk)) shawk
dialog shawk {
  title "Hawkee.com Snippet Searcher"
  size -1 -1 151 33
  option dbu
  box "Search", 1, 0 0 151 34
  text "Snippet name:", 2, 4 8 36 8
  edit "", 3, 41 7 106 10
  button "Search", 4, 91 19 32 12
  combo 5, 32 20 50 35, drop
  box "Snippets found", 6, 0 34 151 42
  list 7, 2 43 147 31, size sort
  box "Snippet Info", 8, 0 76 150 95
  text "Title:", 9, 5 87 14 8
  edit "", 10, 22 86 126 10, read autohs
  text "Description:", 11, 5 111 29 8
  edit "", 12, 36 108 111 16, read vsbar
  text "Author:", 13, 5 98 19 8
  edit "", 14, 26 97 50 10, read autohs
  text "Score:", 15, 77 98 17 8
  edit "", 16, 95 97 51 10, read
  text "Platform:", 17, 5 126 24 8
  edit "", 18, 29 125 44 10, read autohs
  text "Likes:", 19, 75 125 15 8
  edit "", 20, 93 125 54 10, read autohs
  text "Date submitted:", 21, 5 137 40 8
  edit "", 22, 47 136 98 10, read autohs
  text "link:", 23, 5 148 10 8
  link "", 24, 19 148 124 8
  button "Rip This Script!", 25, 41 158 65 11
  text "Platform:", 26, 2 22 27 8
}
on *:dialog:shawk:*:*: {
  if ($devent == init) {
    didtok $dname 5 45 .Net-Byond-C++-Cold Fusion-CSS-HI5-IPhone-Java-JavaScript-mIRC-MySpace-MYSQL-OpenSocial-Perl-PHP-Python-Ruby/Rails-TCL
    did -c $dname 5 10
  }
  elseif ($devent == sclick) {
    if ($did == 4) {
      did -r $dname 7
      did -ra $dname 6 Snippets found
      dialog -sb $dname -1 -1 151 33
      if ($hget(Hawkee)) .hfree $v1
      sockopen SHawk www.hawkee.com 80
      var %a = $+(/snippets/search/,$replace($did(3),$chr(32),_)),%b = $+(/cat/,$did(5).seltext,/),%a = $+(%a,%b)
      sockmark SHawk %a
    }
    elseif ($did == 7 && $hget(hawkee)) {
      dialog -sb $dname -1 -1 151 171
      var %did = $hget(hawkee,$replace($did(7).seltext,$chr(32),_))
      did -ra $dname 10 $replace($hget(hawkee,$did(7).sel).item,_,$chr(32))
      did -ra $dname 24 $+(www.hawkee.com/snippet/,$gettok(%did,1,124),/)
      did -ra $dname 12 $gettok(%did,2,124)
      did -ra $dname 16 $gettok(%did,3,124)
      did -ra $dname 18 $gettok(%did,4,124)
      did -ra $dname 14 $gettok(%did,5,124)
      did -ra $dname 22 $gettok(%did,6,124)
      did -ra $dname 20 $gettok(%did,7,124)
    }
    elseif ($did == 24) url $did($did)
    elseif ($did == 25) rip $gettok($gettok($did(24),-1,47),1,47)
  }
  elseif ($devent == close) { sockclose shawk | .hfree hawkee }
}
on *:sockopen:shawk: {
  sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname HOST: www.hawkee.com $+ $crlf $+ $crlf
  sockmark $sockname
}
on *:sockread:shawk: {
  var %shawk,%a | sockread %shawk
  if ($regex(%shawk,<a href='/snippet/(\d*)/' class='large'>(.*)</a><br>) && !$hget(Hawkee,Cur)) {
    hadd -m Hawkee Cur $replace($regml(2),$chr(32),_)
    hadd Hawkee $hget(Hawkee,cur) $regml(1)
    sockmark $sockname
    sockread %shawk | sockread %shawk | sockread %shawk
    hadd Hawkee $hget(Hawkee,Cur) $addtok($hget(Hawkee,$hget(Hawkee,Cur)),$iif($remove(%shawk,$chr(9)),$v1,No Desc. Available),124)
  }
  elseif ($regex(%shawk,<b>\+ (.*)</b> likes<br>)) { sockmark $sockname $regml(1) }
  elseif ($regex(%shawk,<span class='review_link'>Score: <b>(\d\.\d)</b></span>) && $hget(hawkee,cur)) { hadd Hawkee $hget(Hawkee,Cur) $addtok($hget(Hawkee,$hget(Hawkee,Cur)),$regml(1),124) }
  elseif ($regex(%shawk,<span class='platform'>Platform: <a href="/snippets/cat/.*/">(.*)</a></span>) && $hget(hawkee,cur)) { hadd Hawkee $hget(Hawkee,Cur) $addtok($hget(Hawkee,$hget(Hawkee,Cur)),$regml(1),124) }
  elseif ($regex(%shawk,<span class='userposted'>Posted by <a href='http://www.hawkee.com/profile/.*\/'>(.*)</a> on <b>(.*)</b></span>) && $hget(hawkee,cur)) { hadd Hawkee $hget(Hawkee,Cur) $addtok($+($addtok($hget(Hawkee,$hget(Hawkee,Cur)),$regml(1),124),|,$regml(2)),$sock($sockname).mark,124) | hdel hawkee Cur }
  elseif ($regex(%shawk,We couldn't find any snippets to match your search.<br> You may also search within the snippet code by choosing "Code" on the right.)) { echo $color(info) -a * No Snippets found! | if ($hget(hawkee)) .hfree $v1 | sockclose $sockname }
}
on *:sockclose:shawk: {
  if ($hget(Hawkee)) {
    dialog -sb shawk -1 -1 151 74
    var %a = $hget(hawkee,0).item
    did -ra shawk 6 $+(Snippets found,$chr(40),%a,$chr(41))
    while (%a) {
      did -a Shawk 7 $replace($hget(Hawkee,%a).item,_,$chr(32))
      dec %a
    }
  }
}
alias -l htmlfree { 
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return $remove($replace(%x,&quot;,",&lt;,<,&gt;,>,$cr,. $+ $chr(32),$lf,. $+ $chr(32),&amp;,&,&#40;,$chr(40),&#41;,$chr(41),&#123;,$chr(123),&#125;,$chr(125)),&#91;,$chr(91),&#93;,$chr(93)),$chr(9))
}
 

Comments

  (8)  RSS
Jethro_
Comments: 436
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Sep 27, 2009 6:47 pm
Nice work, sunslayer. I like it when you use the word 'rip' lol
sunslayer
Comments: 266
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Sep 27, 2009 6:50 pm
thanks :p
sunslayer
Comments: 266
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Sep 29, 2009 9:30 pm
added a dialog to search for snippets seeing as just the /rip part of this snippet was pretty useless if you have to search for the url anyways
Cracker200
Comments: 257
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Sep 30, 2009 6:56 pm
OO I like it Nice Work SunSlayer ;)
sunslayer
Comments: 266
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Sep 30, 2009 7:01 pm
thanks :)
Cracker200
Comments: 257
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Oct 1, 2009 12:38 am
Np
Testor
Comments: 81
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Oct 1, 2009 1:31 pm
you = pro :)
sunslayer
Comments: 266
 
mIRC Snippet:  Hawkee.com snippet searcher and "ripper"
Posted on Oct 1, 2009 2:35 pm
lol :p

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom