WoW Search

From Enso Wiki

Jump to: navigation, search
  • NOTE: This command is created for Command Server not as a standalone command

Contents

[edit] Overview: What is WoW Search?

WoW Search is a python script that allows Enso users to search a handful of websites commonly used by World of Warcraft players. A few of the searchable websites include:

  • http://wowwiki.com
    • WoW Wiki provides a wealth of regularly updated information on everything in the World of Warcraft in a user updated wiki
  • http://thottbot.com
    • Perhaps the most well known independent website with detailed information on quests, items, and much more.
  • http://wowarmory.com
    • A great site for reviewing player, guild, and arena information. The beta has a nice 'find upgrade' option for a players current gear as well.

A full list can be found in the Builtin Commands section.

[edit] Bugs / Comments

[edit] Bugs

  • empty searches error out
    • Not sure what's causing this, I may look into this at some point. theonlyalterego August, 6 2008

[edit] Comments

If you find this useful, horrible, or something in between let me know theonlyalterego August, 6 2008

[edit] Builtin Commands

  • wow pet
    • searches http://petopia.brashendeavors.net Note: this searches via the simple search Name field, and as such some logical searches like 'cat' yield nothing but 'lion' will return the lions that are in the Cat family. This appears to be because petopia doesn't search the Family Column in a Name based search, BUT it will search other columns such as Zone, Known Skills, and Level (not level range) which should be enough for most users needs.
  • wow curse
    • searches http://curse.com World of Warcraft Addons Note: this only searches the WoW Addons section, and no other part of the curse website.

[edit] Installation

WoW Search requires that the following be installed and working:

  • Enso - I should hope you know what Enso is at this point :P
  • Enso Developer Prototype - This allows Enso to run development scripts (Python, Java, etc) - Enso Dev-Proto
  • Command Server - An excellent script to wrap up python commands found here Command_Server

Each of the above programs have their own set of requirements and installation instructions. Once they are working you should be able to install the WoW Search script by doing the following:

  • Download the script via the Download section
  • Navigate to the directory where you extracted Command Server
    • Example: C:\MyEnso\command_server
  • Inside you should see a commands directory
    • Example: C:\MyEnso\command_server\commands
  • Move the command_wowsearch.py script (that you downloaded) into the commands directory
    • Note: You should see a number of other python scripts already in this folder. These came with Command Server.
  • Restart Command Server
    • If you've already started the Command Server executed a reload commands in Enso
    • Otherwise just run the ensoCommandServer.pyw script

Once you've prerformed the installation steps above you should be able to use the command listed in the Builtin Commands section above.

For information on configuring Windows to autostart Command Server see the Command_Server

[edit] License

WoW Search - Enso Python Extension by theonlyalterego is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

[edit] Download

You can download the WoW Search - Enso Python Script @ command_wowsearch.py

[edit] Code

#
# WoW Search - Enso Python Extension by theonlyalterego is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
#
# License details here: http://creativecommons.org/licenses/by-nc-sa/3.0/
#
 
from base import BaseCommand
import time
import urllib
import threading
import webbrowser
 
class Command(BaseCommand):
    def __init__(self, *args):
        BaseCommand.__init__(self, *args)
 
#
# Help text
#
# This is the contents of the Enso HTML Help pages
#        
        self.wowHeader = "<h2>World of Warcraft Enso Search</h2>"
        
        self.wowFooter = "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png\" /></a><br /><span xmlns:dc=\"http://purl.org/dc/elements/1.1/\" href=\"http://purl.org/dc/dcmitype/Text\" property=\"dc:title\" rel=\"dc:type\">WoW Search - Enso Python Extension</span> by <a xmlns:cc=\"http://creativecommons.org/ns#\" href=\"http://www.ensowiki.com/wiki/index.php?title=WoW_Search\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">theonlyalterego</a> is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>."
        
        self.wikiHelpText = self.wowHeader + "<h3>Wowwiki Search</h3><p>This will open the <a href=\"http://wowwiki.com/\">WoW Wiki</a> search results page.</p>" + self.wowFooter
        
        self.thottHelpText = self.wowHeader + "<h3>Thottbot Search</h3><p>This will open the <a href=\"http://thottbot.com\">Thottbot</a> search results page.</p>" + self.wowFooter
        
        self.armHelpText = self.wowHeader + "<h3>WoW Armory Search</h3><p>This will open the <a href=\"http://www.wowarmory.com\">World of Warcraft Armory</a> search results page.</p><p>Note: this does a general search</p>" + self.wowFooter
        
        self.petopiaHelpText = self.wowHeader + "<h3>Petopia Search</h3><p>This will open the <a href=\"http://petopia.brashendeavors.net\">Petopia (Brash Endeavors)</a> search results page.</p><p>Note: this searches via the simple search Name field, and as such some logical searches like 'cat' yield nothing but 'lion' will return the lions that are in the Cat family. This appears to be because petopia doesn't search the Family Column in a Name based search, BUT it will search other columns such as Zone, Known Skills, Level (not level range)</p>" + self.wowFooter
        
        self.curseHelpText = self.wowHeader + "<h3>Curse.com Addon Search</h3><p>This will open the <a href=\"http://curse.com\">Curse</a> World of Warcraft addons search results page.</p><p>Note: this only searches the addons section, and no other portion of curse.com</p>" + self.wowFooter
 
#
# Here is the listing of available commands:
#
# wow wiki - searches http://wowwiki.com
# wow thott - searches http://thottbot.com
# wow arm - searches http://wowarmory.com
# wow pet - searches http://petopia.brashendeavors.net
# wow curse - searches http://curse.com WoW Addons
#
 
        self.newArbitraryCommand("wow wiki {Wowwiki Search Text}"
        	, self._wowwiki
        	, "Wowwiki.com Search"
        	, self.wikiHelpText)
        	
        self.newArbitraryCommand("wow thott {Thottbot Search Text}"
        	, self._thottbot
        	, "Thottbot.com Search"
        	, self.thottHelpText)
        	
        self.newArbitraryCommand("wow arm {Armory Search Text}"
        	, self._armory
        	, "Wowarmory.com Search"
        	, self.armHelpText)
        	
        self.newArbitraryCommand("wow pet {Petopia Search Text}"
        	, self._petopia
        	, "petopia.brashendeavors.net Search"
        	, self.petopiaHelpText
        	)
 
        self.newArbitraryCommand("wow curse {Curse Addon Search Text}"
        	, self._curse
        	, "Curse Wow Addon Search"
        	, self.curseHelpText
        	)
#
# wow wiki - searches http://wowwiki.com
#
    def _wowwiki(self, wikiSearch):
        if len(wikiSearch) == 0:
            wikiSearch = self.getUnicodeSelection()
 
        if len(wikiSearch) == 0:
            self.displayMessage("<p>No search criteria found!</p><caption>Please type it in or select it!</caption>")
        else:
            # Setup all of the GET parameters
            params = {
            	     "go": "1",
            	     "search": wikiSearch
                      }
 
            # Create the URL to be opened
            params = urllib.urlencode(params)
            
            url = "http://www.wowwiki.com/Special:Search?" + params
 
            # Open the user's browser to the website
            webbrowser.open(url)
 
#
# wow thott - searches http://thottbot.com
#
    def _thottbot(self, thottSearch):
        if len(thottSearch) == 0:
            thottSearch = self.getUnicodeSelection()
 
        if len(thottSearch) == 0:
            self.displayMessage("<p>No search criteria found!</p><caption>Please type it in or select it!</caption>")
        else:
            # Setup all of the GET parameters
            params = { "s":thottSearch
                      }
 
            # Create the URL to be opened
            params = urllib.urlencode(params)
            
            url = "http://thottbot.com/?" + params
 
            # Open the user's browser to the website
            webbrowser.open(url)
 
#
# wow arm - searches http://wowarmory.com
#
    def _armory(self, armorySearch):
        if len(armorySearch) == 0:
            armorySearch = self.getUnicodeSelection()
 
        if len(armorySearch) == 0:
            self.displayMessage("<p>No search criteria found!</p><caption>Please type it in or select it!</caption>")
        else:
            # Setup all of the GET parameters
            params = { "searchQuery":armorySearch,
                       "searchType": "all"
                      }
 
            # Create the URL to be opened
            params = urllib.urlencode(params)
            
            #http://www.wowarmory.com/search.xml?searchQuery=archeonx&searchType=all
            url = "http://www.wowarmory.com/search.xml?" + params
 
            # Open the user's browser to the website
            webbrowser.open(url)
 
#
# wow pet - searches http://petopia.brashendeavors.net
#
    def _petopia(self, petSearch):
        if len(petSearch) == 0:
            petSearch = self.getUnicodeSelection()
 
        if len(petSearch) == 0:
            self.displayMessage("<p>No search criteria found!</p><caption>Please type it in or select it!</caption>")
        else:
            # Setup all of the GET parameters
            params = { "q":"1",
                       "search_term":petSearch
                      }
 
            # Create the URL to be opened
            params = urllib.urlencode(params)
 
            url = "http://petopia.brashendeavors.net/html/browse/search_advanced.php?" + params
 
            # Open the user's browser to the website
            webbrowser.open(url)
 
 
#
# wow curse - searches curse.com wow addons
#
    def _curse(self, curseSearch):
        if len(curseSearch) == 0:
            curseSearch = self.getUnicodeSelection()
 
        if len(curseSearch) == 0:
            self.displayMessage("<p>No search criteria found!</p><caption>Please type it in or select it!</caption>")
        else:
            # Setup all of the GET parameters
            params = { "q": curseSearch
                       ,"s":"1"
                       ,"x":"13"
                       ,"y":"11"
                      }
 
            # Create the URL to be opened
            params = urllib.urlencode(params)
 
            url = "http://wow.curse.com/downloads/addons/browse/?" + params
 
            # Open the user's browser to the website
            webbrowser.open(url)