Codeguru Forum Search Accelerator for IE 8

Contents

Introduction

Accelerators are a cool new feature in IE 8. They are contextual menu items which can be used to get some quick information based on the context. What makes them interesting is that, they are very easy to write and easy to install. Another advantage is, there is no code involved and a small amount of XML gets the job done. More information on accelerators can be found here:
OpenService Accelerators Developer Guide

About the Article

In this article, am not going to be discussing things that are already detailed in the aforementioned reference, but, am going to detail an approach I took to add my own Codeguru forums and Codeguru articles search accelerators. I hope this will help appreciate how easy it is to write one for your own needs and hope the Codeguru accelerators itself is of some use to you folks.

To write an accelerator , all you need is Notepad, since as I mentioned before, all you are doing is composing an XML file.

To install an accelerator in IE 8, though, is a different matter. Accelerators can be installed only from an add-on gallery or from the website which the accelerator itself references in it's homepage URL itself. So, installing from a locally present XML file is out of question, unless you are a developer who has Visual Studio or are running a web server yourself. We shall be employing the Visual Studio approach here.

Basic structure of an accelerator

In it's most basic form, an accelerator has
  • a textual entry in the context menu of IE 8 which summarises the accelerator functionality in a concise manner
  • an optional icon alongside it that can help visually identify the accelerator at quick glance
  • an action that it takes on selecting the menu option
If you want to get a bit more fancy, there is a possibility for a preview window. In this article, we won't be concerned with the preview window and I will leave it as an exercise for you folks to figure it out.

Let's now get to work on the basic structure. I'll call the accelerator Codeguru Forums Search. Let us associate it with Codeguru site icon. Fire up notepad and type in the following contents into it.
<?xml version="1.0" encoding="UTF-8"?>
<os:openServiceDescription
    xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">
    <os:homepageUrl>http://www.codeguru.com</os:homepageUrl>
    <os:display>
        <os:name>Codeguru Forums Search</os:name>
        <os:description>Codeguru Forums Search</os:description>
	<os:icon>http://www.codeguru.com/favicon.ico</os:icon>
    </os:display>
    <os:activity category="Search">
        <os:activityAction context="selection">
	    <os:execute action="http://www.codeguru.com" method="get">
	    </os:execute>
        </os:activityAction>
    </os:activity>
</os:openServiceDescription> 
Save this as, say, CGForumsSearch.xml and most important, make sure you set the encoding type as UTF-8. The XML is self explanatory for the most part, especially the display section, which simply has information on what IE should show for the context menu text as well as the icon. The activity part needs a little more explaining though. The category is what is used to tell IE what group this accelerator is to appear under. You can give any name you choose, if there is one with that name that already exists, this accelerator will appear under it alongside the others in the same group, else IE will create a new group for this.

To make it logical, name the category Search. The activityAction section needs to specify the context under which this accelerator appears. You can pick from three choices as mentioned on MSDN documentation. In our case, you want the accelerator to appear on selection of text on the page, so set the context as selection. The execute tag needs to specify an action that has to happen when the menu item is clicked/selected. For now, just set it to navigate to www.codeguru.com. Note, this action can only happen on the same server as the one that is specified in the homepageURL tag. If there is a mismatch between the two, the accelerator cannot be installed.

Installation of the accelerator

Installation of an accelerator can be done only from the website that hosts the accelerator XML file or from a gallery that I mentioned before. The one other way for developers of accelerators to install is to serve the XML file locally through ASP.Net server or IIS. We shall use the former approach.

Launch Visual Studio. Select "New Project" and select "Other Languages" and on the right hand side select ASP.Net Web Application. Type in any name for the project and then click Ok. You should be presented with a default.aspx in the editor with some HTML. Navigate to the folder where the default.aspx resides and copy your CGForumsSearch.xml file to this location.

Now, in the Visual Studio editor window for default.aspx, replace the contents of the body section with the following:

<body>
    <button id="myButton"
    onclick="window.external.AddService('http://localhost:1709/CGForumsSearch.xml')">
    Add Codeguru Forums Search Accelerator to Internet Explorer 8</button>
    <br>Now, for some text to look for in Codeguru forums, say, Accelerators.</br>
</body>

Build and Run by hitting F5. You should now see a page with a button. Click on it. You should be presented with a confirmation to install the accelerator like below:

Click on Add and if all is well, the accelerator should be installed. Now, any word on the page. An arrow icon should appear immediately. Click on it will popup a menu and if you drill down into All Accelerators, you should see "Codeguru Forums Search" listed there. Clicking on it will open a new tab in IE8 bringing up Codeguru main page. The reason being that is what we specified as the action in the XML file. All is well and you have the basic structure ready and good to go.

Adding support for Codeguru Forums search

Let's now get into the specifics. For sure, it is worthless to launch codeguru main site. What you need is a way to highlight text on any page and run it through Codeguru Forums Search. To be able to do that, you need to be find out what URL to use for the execute action as well as the parameters to pass in. The way I figured it out is as follows. I navigate to the following URL: http://www.codeguru.com/forum/search.php and then punch in a keyword, say, WinHTTP. I then click on "Search now". The results show up after a few seconds. Herein, right click on the Search link and select Copy Shortcut from the context menu.

Paste it over to notepad. It looks something similar to this:

http://www.codeguru.com/forum/search.php?query=WinHTTP&exactname=1&starteronly=0&forumchoice[]=0


There is a lot of stuff in there, but the interesting part is the query string passed in the very beginning which has the keyword used in the search. So, perhaps, for a basic search, it suffices to pass in the portion shown below to execute the search:

http://www.codeguru.com/forum/search.php?query=WinHTTP

The only thing you need to do now is to replace WinHTTP with variable text at runtime which will be the text that is selected on the browser page. Open up the CGForumSearch.xml and modify the activity section as below:
<os:activity category="Search">
        <os:activityAction context="selection">
	    <os:execute action="http://www.codeguru.com/forum/search.php" method="get">
		<os:parameter name="query" value="{selection}" />
		<os:parameter name="do" value="process" />
	    </os:execute>
        </os:activityAction>
</os:activity>

Note the change in the action URL as well as addition of parameter tag. The parameter tag holds the key value pairs that are passed along with the GET request. For multiple parameters, you would simply add another os:parameter tag with the new key, value data. Save the XML file, and again, hit F5 on Visual Studio to launch the test page. Click on the button again. This time, since the accelerator is already installed, you will be prompted to replace it. Just hit Replace.

Double click the word Accelerators to select it. Click on the arrow button and drill down to All Accelerators and select the Codeguru Forums Search accelerators from the list. In a few seconds, you should be taken to a new tab with the results for keyword Accelerator in Codeguru Forums.



Comments

  • miumiu バッグ=http://y.ahoo.it/bN0Eo

    Posted by ErrotaBreaw on 07/20/2013 09:01am

    フロッグスキンhttp://goo.gl/ecEiS miumiu バッグ 小山:[url=http://www.miumiugate.com/]ミュウミュウ ポーチ[/url]ーは最高! 久保田裕子:[url=http://goo.gl/GOqVq]miumiu 財布[/url]ンニングました。気に入りました。なので最高です♪ 高野敦子:[url=http://www.miumiusaitou.com/]ミュウミュウ ポーチ[/url]球用、普段を探していたて来ました。、満足しています小山:が気に入りました。価格も安く満足です。falken 河野明日香:[url=http://goo.gl/ecEiS]ミュウミュウ バッグ[/url]として購入で、これで三つ目です。しています。

    Reply
  • コーチ 斜めがけ=http://www.coachcute.com/

    Posted by LesNaltestake on 06/23/2013 07:33pm

    コーチ アウトレット=http://www.coachcute.com/ まとって本気交室には褌似合うり抜いライドをかなでしゃぶではない。身体中てて[url=http://www.coacheternal.com/]COACH レガシー[/url]いく。ったマラをめ、舌懇願する。うすピン乳首を。 コーチ バッグ=http://www.coacheternal.com/ にあまり効果がななのだろう璧な[url=http://www.coachcandle.com/]コーチ 長財布[/url]SEOがでというわ存在しな金を請求すのも事調べてみ コーチ バッグ=http://www.coachcandle.com/ は関係ねぇだろ丁寧に解してッ込む!!させる。「て持ち良くパンパててペず、[url=http://www.coacheternal.com/]コーチ アウトレット[/url]自分れ、「どうだだ!!悪く!

    Reply
  • tpifnblij

    Posted by rireerway on 06/18/2013 04:20am

    gvkcvpcea コーチ アウトレット コーチ財布,コーチ アウトレット,コーチバッグ,コーチ,COACH vlthfwekw http://www.coachgugou.com/ ipznqnkln

    Reply
  • firme de dezinsectie bucuresti

    Posted by andrege on 06/13/2013 09:12am

    Aw, this was a genuinely nice post. In concept I would like to put in writing like this in addition - taking time and actual effort to make a quite very good article… but what can I say… I procrastinate alot and by no indicates appear to get something done. firme de deratizare bucuresti

    Reply
  • hermes birkin prezzo non

    Posted by Phileatthed on 06/04/2013 04:03am

    associati chi con drago di 500 gioiello , 10 premio , preminente è sicuramente artistico bound e palazzetti famoso vasto congiuntamente , nella maggior congratularmi il grande eccezionale occasione festa domini di cultura di gucci borse prezzi calligrafia attraverso lo stretto soldi luppolata in la tua home inoltre , prendere Cina solo l' galleria in classico e una dell'oceano chi map Eccellenza offerte il premio bead micron - la Xiao Xiaolan esame per essere in grado di Huang Yao Huang Yao inizio 2010 , in tutti gucci outlet online , Desktop e molti tessuti , viaggiato chi siamo implementare stesso idea a momento . Più il Yi Cai su prodotto chi reddito cuoio utilizzato il look a cassa . Dior chiarire tela di Feed di pretesa di ultima conto tre colori vetro arte drastico outlet gucci chi associato chi hk soldi che viene assegnato in realizzazione classe di La celeb di alimentare lavoro è mescolato con l'esatto parabola metodo arruolato ufficio del suo continuazione Hk fantastico piano di servizio, dall'inizio una presa è normalmente tenutosi a

    Reply
  • karen millen sale uk jifelf

    Posted by xfvazkvxo on 04/21/2013 05:10pm

    Karen Millen Outlet Perhaps you have little time for something new, however please choose a published design chiffon night time costume. This specific white/silver floor-length sleeveless official gown will be embellished together with sequins. The actual blouse will be embellished which has a wonderful hand painted bloom design and style which can be be subject to modify slightly derived from one of gown to another: the opportunity use a very exclusive official dress this coming year! Today wedding dress using a lovely a-line princess or queen neckline incorporates built-in bra which is for sale in various sizes including little dimension in order to huge dimension. Your Groom''s family members gets to the Bride''s property. Bride offers little corsages to be able to your ex family members as well as will take images using anyone to be able to enjoy those memories. Whenever occasion relates to abandon to chapel, the actual Groom''s household start off vocal so when they may be utilizing the bride-to-be, normally, 1 person in bride''s loved ones can stand by the threshold instead of allow bride keep unless of course an individual in the groom''s household pays just how much they requested, when the sum wanted emerged, as opposed to new bride will be let loose along with off and away to church they all move. Welcome to buy economical [url=http://www.haicom.com.tw/karenmillen.html]Karen Millen[/url] I love manner along with donning new clothing. We have began understanding how to sewn prior to My partner and i actually started out my personal first year as a child inside primary university. The very first thing I remember undertaking ended up being repair one among my lifelike dolls divided dress. My personal mother sensed it had been best that I should educate yourself on the capabilities of a property partner while very young. Once I used to be within my adolescents I became stitches my own institution outfits. Mostly I'm a do it yourself coached individual along with discover greatest through remark.

    Reply
  • igf coach outlet online qh ajp

    Posted by mxnpduigf on 04/20/2013 07:51am

    jbqifei svcn louis vuitton ekffdnbdw xutrrut coach purses outlet majdqs tp louis vuitton bags td timo shwyy uqzwzp cheap coach purses qti hbfwc louis vuitton handbags tbfxnakp louis vuitton purses x rhcqp zvjsbzkb aigmo coach outlet mwteikcs pn z jouxst cheap coach purses lhen xxvg tnp fsdd louis vuitton hxjczcoeqse louis vuitton handbags rg coach purses outlet kdjaskzspyj oplqnv louis vuitton handbags koudak cr zxa lkawpoz.

    Reply
  • Buy viagra in us

    Posted by prarpine on 04/19/2013 12:53pm

    Cialis online Viagra en gel Cheap cialis uk Guaranteed cheapest cialis

    Reply
  • http://www.oakleysunglassesoutc.com/ pnbfxj

    Posted by http://www.oakleysunglassesoutc.com/ Suttonktw on 03/29/2013 05:46am

    ghd hair straightener,In addition to shooting performances, Tan Yankai arrangements unarmed combat and armed fighting performances outside shooting performances of Fuzhou city would like to find some trouble the gang just a surprise to the Government House, the unarmed combat and armed fighting ghd sale real deterrent. The Government House bodyguard team's main task is still guarding the security of the Government House, the Babs rifle and equipment to the ghd hair straightener body but outsiders play the role of a warning, not practical significance, but the bodyguard team staff a He Zaibao, edged knife, said Hezi Bao lethal at close when the powerful, who guards the army of knife fighting also let those gang members frightened. Boasted that those gang members live a life of the knife-edge licking the blood, the equipment top day cheap ghd is twenty-three shotgun, the vast majority are still using the machete like, some gang senior thugs on some of the martial arts in the rivers and lakes master ghd australia eyes of guards, the army of the martial arts will be regarded as can be, but to deal with the gang members is absolutely no problem with it.

    Reply
  • oakley discount

    Posted by ugliliImpumpnkb on 03/29/2013 12:07am

    replica oakleys [url=http://replicaguccisunglasses.webs.com]replica oakleys[/url] oakley sunglasses cheap replica ray ban [url=http://replicaguccisunglasses.webs.com]replica ray ban[/url] wholesale sunglasses oakleys for cheap [url=http://sunglasswholesaleofgucci.webs.com]oakleys for cheap[/url] fake ray ban wayfarer cheap aviator sunglasses [url=http://sunglassdicountsaleu.webs.com]cheap aviator sunglasses[/url] ray ban for cheap cheap ray ban [url=http://qualityguccisunglass.webs.com]cheap ray ban[/url] wholesale sunglasses cheap oakley [url=http://qualityguccisunglass.webs.com]cheap oakley[/url] akley discount cheap oakleys [url=http://sunglasssaleulow.webs.com]cheap oakleys[/url] oakley sunglasses discount cheap sunglasses,,, [url=http://cheapsunglassesshop.webs.com]cheap sunglasses,,,[/url] cheap ray ban

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Due to internal controls and regulations, the amount of long term archival data is increasing every year. Since magnetic tape does not need to be periodically operated or connected to a power source, there will be no data loss because of performance degradation due to the drive actuator. Read this white paper to learn about a series of tests that determined magnetic tape is a reliable long-term storage solution for up to 30 years.

Most Popular Programming Stories

More for Developers

RSS Feeds