!snippet : get latest snippet from hawkee.com

By QuickStep on Aug 22, 2005

A snippet to retrieve the latest snippet. Enjoy. This is a very simple version, someboy may improve it if they feel like it

;Usage: somebody must type !snippet in the channel

;If somebody types:
;  !snippet <-- Messages latest mirc snippet
;  !snippet mirc <-- Also messages latest mirc snippet
;  !snippte php <-- Messages latest php snippet
;  !snippet tcl <-- Messages latest tcl snippet
;As you can see '!snippet' is enough to retrieve a mirc snippet

on *:TEXT:!snippet*:#:{
  var %sock = $+(hawkee,#,$nick), %type = $iif($2 isin tcl php,$v1,mirc)
  ;msg # Now checking http://www.hawkee.com for the latest snippet...
  if ($sock(%sock)) return
  sockopen %sock www.hawkee.com 80
  sockmark %sock $lower(%type) #
on *:SOCKOPEN:hawkee*:{
  var %a = sockwrite -n $sockname
  %a GET $+(/snippets.php?snippet_type=,$getmark($sockname,1)) HTTP/1.1
  %a Host: www.hawkee.com
  %a Connection: close
  %a $crlf
on *:SOCKREAD:hawkee*:{
  var %temp, %re = <a href="snippet.php\?snippet_id=([[:digit:]]+)">(.+)</a>
  sockread %temp
  if ($regex(%temp,%re) && ($regml(0) = 2)) {
    msg $getmark($sockname,2) Latest $+($chr(31),$getmark($sockname,1),$chr(31)) snippet: $&
      $+($chr(2),NAME,$chr(2)): $regml(2) $+($chr(2),URL,$chr(2),:) $&
    sockclose $sockname
alias -l getmark return $gettok($sock($1).mark,$$2,32)


Sign in to comment.
Eugenio   -  Feb 22, 2008

oh right

Hawkee   -  Feb 22, 2008

I\'m sure Quickstep needs to modify the code. Our HTML layout changed since he originally posted which probably broke the scraper.

Eugenio   -  Feb 22, 2008

Dont Work!

Hawkee   -  Mar 21, 2007

I think I may have just broken this with the new snippet system.

`Shippo   -  Oct 26, 2005

Awesome script I like it and so do my friends and yoinx is right you should be more active here.

Yoinx   -  Aug 24, 2005

That\'s good, You\'re an amazing scripter and it would be great to see you more active here. :)

QuickStep   -  Aug 23, 2005

Thanks for the positive feedback guys. This is the motivation that I need to do more for the hawkee community

Hawkee   -  Aug 23, 2005

No, but I\'ll have to implement one someday.

Yoinx   -  Aug 23, 2005

Do you have an RSS feed?

Hawkee   -  Aug 23, 2005

How about making this into a snippet RSS server, that\'d be pretty cool.

DeathRyder082   -  Aug 22, 2005

;msg # Now checking http://www.hawkee.com for the latest snippet...
Don\'t know if you wanted the \';\' there, just wanted to point that out. I like this idea, and It would be nice if someone could update this to download perhaps maybe one of the top ten scripts on command? And the same with snippets, like someone type the snippet name, it checks the archive and returns it, then they select which one they want and they can download it. Thats a bit extreme though. I give this a 8, I can perdict more to come to this same idea on here.

Zachery   -  Aug 22, 2005

soo cool keep up the good work

brottor   -  Aug 22, 2005

Ya nice snippet but only thing is...ima make it so i can get em myself:D

Hawkee   -  Aug 22, 2005

Pretty cool QuickStep, Thanks for the Support!

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.