Wowhead World of Warcraft Search

By FordLawnmower on Jul 25, 2009

Image
Script searches www.Wowhead.com for matches based on the category you select.
This script was written at the request of Scofield.
Usage:

  • Copy this code, paste to new remote, Save with a unique name.
  • Right click channel or status, click Wowhead and turn the trigger on.
    Syntax:
  • !Wowhead -- Results are noticed to user.
  • @Wowhead -- Result are messaged to the channel if user is Op.
    Otherwise they are noticed to the user.
    Categories:
  • items
  • itemsets
  • npcs
  • objects
  • quests
  • spells
  • achievements
    Examples of usage:
  • !Wowhead items sword
  • @Wowhead spells fire
  • !Wowhead knife -- This works because the default category is item.
;WowHead script by Ford_Lawnmower irc.GeekShed.net #Script-Help
;This script was written at the request of Scofield to search www.wowhead.com and return the first 3 results.
;The syntax is !wowhead search items or @wowhead search items. ! trigger notices the user. @ trigger messages the channel. @ trigger defaults to notice if user is not Op. 
#wowhead on
On $*:Text:/^(!|@)WowHead+/Si:#: {
  if ($timer($+(WowHead,$network,$nick))) { return }
  .timer $+ $+(WowHead,$network,$nick) 1 4 noop
  var %rq $regml(1)
  if (!$2) || (($wowsearch($2)) && (!$3)) { $replace(%rq,!,.notice $nick,@,$iif($nick isop $chan,.msg $chan,.notice $nick)) 07W06o04w09h07e06a04d06 $WowHelp | return }
  WowHead $replace(%rq,!,.notice $nick,@,$iif($nick isop $chan,.msg $chan,.notice $nick)) $strip($iif($wowsearch($2),$v1 $3-,items $2-))
}
#wowhead end
menu Channel,Status {
  Wowhead
  .$iif($group(#wowhead) == On,$style(1)) Wowhead Trigger
  ..$iif($group(#wowhead) == On,$style(2)) On: .enable #wowhead
  ..$iif($group(#wowhead) == Off,$style(2)) Off: .disable #wowhead
}
alias -l WowHead {
  var %sockname $+(WowHead,$network,$2,$ticks)
  sockopen %sockname www.wowhead.com 80
  sockmark %sockname $1-2 $3 $replace($4-,$chr(32),+)
}
On *:Sockopen:WowHead*: {
  if (!$sockerr) {
    sockwrite -nt $sockname GET $+(/,$gettok($sock($sockname).mark,3,32),&filter=na=,$gettok($sock($sockname).mark,4,32)) HTTP/1.0
    sockwrite -n $sockname Host: www.wowhead.com $+ $str($crlf,2)
  }
  else { echo -st Socket error $script | sockclose $sockname | return }
}
On *:Sockread:WowHead*: {
  if ($sockerr) { echo -st Socket error $script | sockclose $sockname | return }
  else {
    var %WowHead | sockread %WowHead
    tokenize 59 %WowHead
    if (No Results for isin %WowHead) || (Your criteria did not match any isin %WowHead) { 
      $gettok($sock($sockname).mark,1-2,32) 07W06o04w09h07e06a04d06 No results found
      sockclose $sockname
      return 
    }
    elseif (($regex($1-3,/\[([\d]+)\]\=\{name_enus:'(.+?)'/gi)) || ($regex(%WowHead,/"id":([\d]+)\x2c"location":.*?\x2c"name":"(.*?)"/gi))) {
      var %wlogo 07W06o04w09h07e06a04d06, %count 0, %type $fixcat($gettok($sock($sockname).mark,3,32))
      while (%count <= 4) {
        $gettok($sock($sockname).mark,1-2,32)  %wlogo $regml($calc(%count + 2)) $+($chr(2),http://,$sock($sockname).addr,/,%type,=,$regml($calc(%count + 1)))
        inc %count 2
      }
      $gettok($sock($sockname).mark,1-2,32) %wlogo For more results see $+(07,http://www.wowhead.com/,$gettok($sock($sockname).mark,3,32),&filter=na=,$gettok($sock($sockname).mark,4,32))
      sockclose $sockname
      return
    }
  }
}
alias -l wowhelp { return Syntax is 07!WowHead <type> <search words> -06 Valid types are -07 items,itemsets,npcs,objects,quests,spells & achievements. }
alias -l wowsearch {
  if ($len($1) < 3) { return 0 } 
  elseif ($regex($1,/^(items)(e|et|ets)/Si)) { return itemsets }
  elseif ($wc($1,npcs)) { return npcs }
  elseif ($wc($1,objects)) { return objects }
  elseif ($wc($1,quests)) { return quests }
  elseif ($wc($1,spells)) { return spells }
  elseif ($wc($1,items)) { return items }
  elseif ($wc($1,achievements)) { return achievements }
  return 0
}
alias -l wc { return $iif($1 == $left($2,$len($1)),$2,0) }
alias -l fixcat {
  if ((npc isin $1) || (object isin $1) || (achievement isin $1)) return $v1
  else return item
}

Comments

Sign in to comment.
edb   -  Jun 15, 2011

Yeah i think the patch busted a lot of sites and the way they do things.. as i said im no expert just didnt realize you were active so i was trying to fix things up. there are some people that enjoy these :)

 Respond  
FordLawnmower   -  Jun 04, 2011

Script is Updated and should be working again.
If nobody posts problems , I have no way to know when this script is broken. I do NOT and have never used this.
@edb Your edit is here -->> http://pastebin.com/2z30xknF

 Respond  
FordLawnmower   -  Apr 21, 2010

Updated This script Broke ;/ The code at the top is updated to fix it.
Thanks to mouse on irc.geekshed.net for bringing this to my attention.

 Respond  
Serjul   -  Sep 15, 2009

found a new bug, reported it in a pm but i guess you couldn't read it , so here it is :
01[16:31] Ford_Lawnmower : since hawkee is down
01[16:32] i wanna report a bug on the wowhead search, just found now
01[16:32] !wowhead zones doesnt work as it should
01[16:32] if u type anything it always gives u 1 result
01[16:32] [04:30] <~Scofield> !wowhead zones ulduar
01[16:32] [04:30] <&Cuty> 4(Wowhead)- Alterac Mountains http://www.wowhead.com/?zone=36
01[16:32] [04:30] <&Cuty> 4(Wowhead)- Alterac Valley http://www.wowhead.com/?zone=2597
01[16:32] [04:30] <&Cuty> 4(Wowhead)- For more results see http://www.wowhead.com/?zones&filter=na=ulduar
01[16:32] 04:31] <~Scofield> !wowhead zones orgrimmar
01[16:32] [04:31] <&Cuty> 4(Wowhead)- Alterac Mountains http://www.wowhead.com/?zone=36
01[16:32] [04:31] <&Cuty> 4(Wowhead)- Alterac Valley http://www.wowhead.com/?zone=2597
01[16:32] [04:31] <&Cuty> 4(Wowhead)- For more results see http://www.wowhead.com/?zones&filter=na=orgrimmar
01[16:32] tho
01[16:33] if i type it in wowhead
01[16:33] heres the result of zones
01[16:33] http://www.wowhead.com/?search=ulduar#zones

 Respond  
FordLawnmower   -  Aug 05, 2009

@Serjul the error is in the site. If you go to the site and do the same search all the site will give you is a list of factions in alphabetical order. Click this link and see --->> http://www.wowhead.com/?factions&filter=na=horde
The search engine does not sort the factions by relevance for some reason. I could write script to sort them, but I would need a thorough explanation of how they should be sorted based on order of importance.
For instance, the site has columns name, side and category. Would the search just check the name column or would it be a combination of the three? If it is the latter then which column would hold the highest search value and to what extent.
I have no idea what a world of warcraft faction is, so I will need a detailed explanation of how to search these results in order to script an engine.

 Respond  
Serjul   -  Aug 05, 2009

ive been checking each type of wowhead script search and i found one bug, hopefully u fix it :

when you do !wowhead faction , no matter whats the search u put, it always gives u the first 3 results in faction page, it doesnt search for the search term u typed, for example :
<~Scofield> !wowhead faction exodar
<&Cuty> 4(Wowhead)- Alliance Vanguard http://www.wowhead.com/?faction=1037
<&Cuty> 4(Wowhead)- Argent Crusade http://www.wowhead.com/?faction=1106
<&Cuty> 4(Wowhead)- Argent Dawn http://www.wowhead.com/?faction=529
<&Cuty> 4(Wowhead)- For more results see http://www.wowhead.com/?factions&filter=na=exodar

<~Scofield> !wowhead faction horde
<&Cuty> 4(Wowhead)- Alliance Vanguard http://www.wowhead.com/?faction=1037
<&Cuty> 4(Wowhead)- Argent Crusade http://www.wowhead.com/?faction=1106
<&Cuty> 4(Wowhead)- Argent Dawn http://www.wowhead.com/?faction=529
<&Cuty> 4(Wowhead)- For more results see http://www.wowhead.com/?factions&filter=na=horde

it should search for the search term the nick types, as the rest of them do

 Respond  
Serjul   -  Aug 03, 2009

thanks alot :)

 Respond  
FordLawnmower   -  Aug 02, 2009

Fixed --
Thanks Serjul :)

 Respond  
Serjul   -  Aug 02, 2009

yo Ford, i've found a small bug in the wowhead script, hopefully you fix it , when you search for anything and it has only one result, it shows three results but the rest two results are " www.wowhead.com " , it shouldn't show those at all, it should only give the 1 result , if its two then two, if its three then it gives three, if its three+ then it gives the three results with the link to see the rest of em, for example:

!wowhead item frozen orb -Cuty- 4[Wowhead] Frozen Orb http://www.wowhead.com/?item=43102 -Cuty- 4[Wowhead] http://www.wowhead.com -Cuty- 4[Wowhead] http://www.wowhead.com -Cuty- 4[Wowhead] For more results see http://www.wowhead.com/?items&filter=na=frozen+orb -- !wowhead item void -Cuty- 4[Wowhead] Band of the Crystalline Void http://www.wowhead.com/?item=31923 -Cuty- 4[Wowhead] Legplates of the Endless Void http://www.wowhead.com/?item=45594 -Cuty- 4[Wowhead] Pattern: Robe of the Void http://www.wowhead.com/?item=14514 -Cuty- 4[Wowhead] For more results see http://www.wowhead.com/?items&filter=na=void this one is working properly since it has more than 3+ results, but if its 1 or two it gets bugged
 Respond  
Serjul   -  Jul 26, 2009

cheers mate, couldnt believe u'd post it few hours after i requested it :) , the snippet is great and as i can see it has no bugs at all

10 from me

  • Scofield
 Respond  
FordLawnmower   -  Jul 26, 2009

Thanks zNigel- :) I've never even played the game before myself but it looks intresting.

 Respond  
zNigel-   -  Jul 26, 2009

Very nice mate, you should've made it alot earlier cuz i used wowhead alot before, but kinda quitted playing now ^^ gets 8 from me since it very useful for wownerds etc.

/me cheers

 Respond  
FordLawnmower   -  Jul 25, 2009

One thing to add: With the exception of "items", You can short hand the categories by using the first 3 letters instead of the whole word.
Ex. !Warhead ach work -- is the same result as typing !Warhead achievements work.
Anything in between will also work, such as !Warhead achieve work .

 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.