Top

Hawkee Snippets/Images/Forum "Detector"


mIRC Code
+ 3 likes
Please Register to submit score.
Bookmark and Share
Average Score  8.3 (of 4 scores)
Date Added  Apr 01, 2009
Last Updated  Apr 05, 2009
Tags  detector  forum  hawkee  image  snippet 

Introduction

I don't remember who exactly requested this, but it is done.
This small, neat snippet is similar to my YouTube Video "Detector", but has some extensions:

Syntax: Just post any Hawkee url to a snippet, image, or forum topic page in a channel.

    Snippets
  • Code Language
  • Title
  • Submitter
  • Average Score
  • Likes
  • Date Added
  • Last Updated
  • Comments Received
    Images
  • Public/Private Image
  • Title
  • Submitter
  • Description
  • Likes
  • Date Added
  • Comments Received
    Forum
  • Forum Name
  • Title
  • Author (Descriptions)
  • Date Posted
  • Comments Posted (Statistics)

Special thanks to Jonesy44 for giving me a hand with the regex on the on text event.

Here's a picture:



Enjoy! :D

Grab the Code

alias -l addmark { return $+($sock($1).mark,$chr($3),$2) }
alias -l between { noop $regex($1,/\Q $+ $2 $+ \E(.*?)\Q $+ $3 $+ \E/gi) | return $regml($4) }
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;,&),$chr(9)) }
alias -l smsg { msg $iif(c isincs $chan($1).mode,$1 $strip($2-),$1-) }
 
on *:text:*:#: {
  if ($regex($1-,(http\:\/\/)www\.hawkee\.com\/(snippet\/\d*|profile\/img\/\d*|phpBB2\/viewtopic\.php\?t=\d*))) { sockopen hawkee www.hawkee.com 80 | sockmark hawkee $+(#,|,$+(/,$regml(2),/),|,$gettok($regml(2),$iif($numtok($regml(2),47) > 2,2,1),47)) }
}
 
on *:sockopen:hawkee: { tokenize 124 $sock(hawkee).mark | sockwrite -n $sockname GET $2 HTTP/1.0 | sockwrite -n $sockname Host: www.hawkee.com $+ $crlf $+ $crlf }
on *:sockread:hawkee: {
  tokenize 124 $sock(hawkee).mark
  if ($3 == snippet) {
    sockread %hawkee
    if (<title> isin %hawkee) { var %x $htmlfree(%hawkee) | sockmark hawkee $addmark(hawkee,$gettok(%x,1 - $calc($numtok(%x,45) - 1),45),124) | sockmark hawkee $addmark(hawkee,$gettok($gettok(%x,$numtok(%x,45),45),1 - $numtok(%x,32),32),124) }
    if (<td align=left width=290 style="font-size: 14px"><b> isin %hawkee) { sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (likes<br> isin %hawkee) { sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (<td align=left>Date Added&nbsp;</td> isin %hawkee) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (<td align=left>Last Updated&nbsp;</td> isin %hawkee) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (<a href='/snippets/'>Code Snippets</a> isin %hawkee) { sockmark hawkee $addmark(hawkee,$gettok($gettok($htmlfree(%hawkee),3,62),1,39),124) }
    if (<h1 style="display: inline;">Comments</h1> isin %hawkee) { sockmark hawkee $addmark(hawkee,$remove($gettok($htmlfree(%hawkee),2,32),$chr(40),$chr(41)) comment(s),124) }
  }
  elseif ($3 == img) {
    sockread %hawkee
    if (<title> isin %hawkee) { sockmark hawkee $addmark(hawkee,$gettok($htmlfree(%hawkee),1 - $calc(%numtok(%x,45) - 1),45),124) }
    if (<span style="color: #777; font-size: 11px;"> isin %hawkee) { sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (" style="display: inline;"> isin %hawkee) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (<div style="padding-bottom: 10px;"> isin %hawkee) { sockread %hawkee | sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (<div class='itemfooter'> isin %hawkee) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
    if (My Images</a> isin %hawkee) { sockmark hawkee $addmark(hawkee,$gettok($gettok($htmlfree(%hawkee),2,62),1,39),124) }
    if (<img src='/images/spacer.gif' height=2 width=1><br> isin %hawkee) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) }
  }
  elseif ($3 == phpBB2) {
    sockread %hawkee
    if (<title> isin %hawkee) { sockmark hawkee $addmark(hawkee,$gettok($gettok($htmlfree(%hawkee),$numtok($htmlfree(%hawkee),45),45),1 - $numtok($htmlfree(%hawkee),32),32),124) }
    if (Hawkee.com Forum Index</a> isin %hawkee) { inc %hawk | if (%hawk == 1) { sockread %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree(%hawkee),124) } }
    if (<td width="150" align="left" valign="top" class="row1"><img src='/images/spacer.gif' width=150 height=1><br><span class="name"> isin %hawkee) { inc %hawk2 | if (%hawk2 == 1) { var %x %hawkee | sockmark hawkee $addmark(hawkee,$htmlfree($between(%x,</a><b>,</b></span><br />,1) $+($chr(40),$chr(32),$between(%x,<br /><br />,<br />Posts:,1) $chr(47) $between(%x,<br />,<br />,3) $chr(47) $iif($between(%x,<br />L,</span><br /></td>,1),$+(L,$v1),No Location)),$chr(41)),124) } | sockmark hawkee $addmark(hawkee,%hawk2,124) }
    if (<span class="gen"> isin %hawkee) { inc %hawk3 | if (%hawk3 == 1) { sockmark hawkee $addmark(hawkee,$between(%hawkee,<span class="postdetails">Posted: ,<span class="gen">,1),124) } | sockmark hawkee $addmark(hawkee,%hawk3,124) }
  }
}
on *:sockclose:hawkee: {
  tokenize 124 $sock(hawkee).mark
  if ($3 == snippet) { smsg $1 [7H14awkee]: $+($chr(40),,$5,,$chr(41)) - Title: $4 - Submitted by: $6 - Average Score: $8 - Likes: $7 - Date Added: $9 - Last Updated: $10 - Comments received: $11 }
  elseif ($3 == img) { smsg $1 [7H14awkee]: $+($chr(40),,$6,,$chr(41)) - Title: $4 - Submitted by: $5 - Description: $8 - Likes: $7 - Date Added: $10 - Comments received: $9 }
  elseif ($3 == phpBB2) { smsg $1 [7H14awkee]: $+($chr(40),,$3,$chr(32),/,$chr(32),$5,,$chr(41)) - Title: $4 - Author: $6 - Date Posted: $8 - Comments Posted: $+(,$calc($9 + $10), comments in total) - $+($chr(40),$chr(32),,$9, comments by threadstarter / ,$iif($10,$v1,0), comments from others,$chr(32),$chr(41)) }
  unset %hawk*
}

Comments

  (8)  RSS
jonesy44
Comments: 1,856
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 2, 2009 6:10 am
Nice job Kirby. Nicely done ;) 9/10
MaxEvans
Comments: 89
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 2, 2009 7:43 pm
Awesome, I'll definitely use this.

/me rates 9/10 =]
Kirby
Comments: 475
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 2, 2009 8:11 pm
Thanks. :D
Hawkee
Comments: 1,039
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 2, 2009 9:29 pm
You probably want to minimize the amount of HTML you're matching against because it's very likely we'll be making changes to the design that will break this snippet.
Kirby
Comments: 475
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 5, 2009 8:33 pm
Quote:
You probably want to minimize the amount of HTML you're matching against because it's very likely we'll be making changes to the design that will break this snippet.
I actually have tried my best to use as little tags as possible, and to get as much information out of those tags, for this script.
If new changes are made to the website, or whenever changes are made, I will update this snippet as soon as possible.
jonesy44
Comments: 1,856
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 6, 2009 9:30 am
"we'll be making changes"
Who's "we"?
Hawkee
Comments: 1,039
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 6, 2009 3:53 pm
jonesy, I'm just referring to the Hawkee.com business entity.
jonesy44
Comments: 1,856
 
mIRC Snippet:  Hawkee Snippets/Images/Forum "Detector"
Posted on Apr 6, 2009 5:17 pm
ok

Commenting Options

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

  
Bottom