Perfecting imperfection daily…
200927Jun

ITPub Search :: Custom Firefox Search Plugin

Posted in IT

I was searching around on ITPub, China’s most notorious IT-related website, and wanted an easy way to search for their books. Every time I go there I have to login, then go home, then search, then scan the results for my book, ALL IN CHINESE. I don’t know if you’re like me but, I hate trying to make sense of 26,000 Chinese letters, so I came up with a quick and dirty plug-in for Firefox to search ITPub.net very quickly.

Screenshot:

When finished your search bar should look like this.

When finished your search bar should look like this.

So after  a bit of Googling and hacking, I found an easy way to add a custom search into your Firefox search bar (next to the url). I even ghetto-rigged a favicon inside of it, even though it does no justice to the normal ITPub.net favicon (I wasn’t able to extract this from their website, even though their HTML source code is ONLY 50% Chinese).  Without further adieu, here are the steps necessary to make a custom Firefox search plugin for ITPub.net and begin finding your favorite IT-related books:

  1. Navigate to the C:\Program Files\Mozilla Firefox\searchplugins directory of your computer (assuming you are running Windows)
  2. Copy and Paste ANY of the current search plugin files (.xml) and rename it to “itpub.xml”.
  3. Open the newly created .xml file in Notepad (easiest) to prepare it for editing.
  4. Delete everything inside of it (or read it, if you want to know what is going on). If you choose one like Google or Yahoo! (assuming you have both of them installed), you can also see how they do their type-ahead search feature based off the first few letters that you type in the search box.
  5. Paste the exact code shown below, then save and close:

    <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
    <ShortName>IT Pub</ShortName>
    <Description>ITPub.Net Search</Description>
    <InputEncoding>UTF-8</InputEncoding>
    <Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAA
    AAAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAA
    gAAAAIAAAACAAABjgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACA
    AAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAACAAICAgACAgIAAgICAAICAgACAgIAAgICAAICAgACA
    gIAAgICAAICAgACAgIAAgIAAgAAAAIAAAACAAAAAgAAA3ADc3NwA3NzcANzc3ADc3NwA3NzcANzc
    3ADc3NwA3NzcANzc3ADc3NwA3NyAAICAAIAAAACAAAAAgAAAAIAAANwA3NzcANzc3ADc3NwA3NwA
    gAAAAIAAAACAAADcANzc3ADc3NwA3NzcANzcgACAgACAAAAAgAAAAIAAAACAAADcANzc3ADc3NwA
    3NyAAICAAIAAAACAAAAAgAAAAIAAANwA3NzcANzc3ADc3IAAgIAAgAAAAIAAAACAAAAAgAAA3ADc
    3NwA3NzcANzcgACAgACAAAAAgAAAAIAAAACAAADcANzc3ADc3NwA3NyAAICAAIAAAACAAAAAgAAA
    AIAAANwA3NzcANzc3ADc3ACAAAAAgAAAAIAAAACAAAAAgAAA3ADc3NwA3NzcANzcgACAgACAAAAA
    gAAAAIAAAACAAADcANzc3ADc3NwA3NwAgAAAAIAAAIAAgIAAgAAAAIAAANwA3NzcANzc3ADc3IAA
    gIAAgAAAAIAAAACAAAAAgAAAgACAgIAAgICAAICAAIAAAACAAADcANzcAIAAAACAAADcANzc3ADc
    3NwA3NyAAICAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAA3ADc3IAAgIAAgAAA
    AIAAANwA3NzcANzcgACAgACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAANwA3NyA
    AICAAIAAAACAAADcANzc3ADc3IAAgIAAgAAAAIAAAACAAAAAgAAA3ADc3NwA3NzcANzc3ADc3NwA
    3NzcANzcgACAgACAAAAAgAAA3ADc3NwA3NyAAICAAIAAAACAAAAAgAAAAIAAANwA3NzcANzc3ADc
    3NwA3NzcANzc3ADc3NwA3NwAgAAAAIAAANwA3NzcANzcgACAgACAAAAAgAAAAIAAAACAAAAAgAAA
    AIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAA
    gAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACA
    AAAA//4AAP//AACABwAAgAcAAIcHAACHhwAAh4cAAI+HAACNhwAAjYcAAPzHAAD8xwAAgMcAAIDH
    AAD//wAA//8AAA==</Image>
    <Url type="text/html" method="GET" template="http://www.itpub.net/search.php">
    <Param name="srchtxt" value="{searchTerms}"/>
    <Param name="orderby" value="lastpost"/>
    <Param name="ascdesc" value="desc"/>
    <Param name="searchsubmit" value="yes"/>
    </Url>
    <SearchForm>http://www.itpub.net/search.php</SearchForm>
    </SearchPlugin>
  6. Save and close.

That’s It! Now close and restart Firefox and check the Search bar and look for your newly created ITPub.net plugin. Enjoy!

Leave a Comment