For my first post, I’d like to discuss my quick, simple entry into the Social Actions Change the Web contest.
Unfortunately, I wasn’t aware of this contest until it was a little late to do anything too big, so I decided to do a quick search tool for FireFox, as per several request from Social Actions users and operators.
Writing search plugins for Firefox is a quick way to add a lot of functionality to your browser.
First, the code:
1 2 3 4 5 6 7 8 9 10 11 12 | <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <ShortName>SocialActions</ShortName> <Description>SocialActions - You make a difference, we make it easy</Description> <InputEncoding>UTF-8</InputEncoding> <Image width="16" height="16" type="image/x-icon">http://www.socialactions.com/files/socialactions_favicon.ico</Image> <Url type="text/html" method="GET" template="http://search.socialactions.com/actions"> <Param name="q" value="{searchTerms}"/> </Url> <Url type="text/html" template="http://search.socialactions.com/actions"/> <moz:SearchForm>http://search.socialactions.com/</moz:SearchForm> </OpenSearchDescription> |
Yep, that’s all there is to it. As you can see, it’s simply a matter of plugging in the right information into the template, assuming you know a few things about the search tool you’re working with.
You can easily figure out everything you need to know by simply making a search and noting the resulting URL. Making a search for ‘test’ on Social Actions results in the following URL:
http://search.socialactions.com/actions?q=test
We can now see that Social Actions uses a q parameter for searches, so we tell the code that the Param name="q" and that its value is {search terms}, which will grab everything that is typed in the search box. Also, we need to tell the code what URL to append these parameters to. Again, from the search result URL, we see that the search URL is http://search.socialactions.com/actions. Now our code knows to append &q=TextFromSearchBox after the search URL, which will then send you to the search engine’s results page.
Finally, you can polish your search plugin by adding a ShortName, Description and Image.
Once you complete your search plugin, you can add it to Mozilla’s add-on site (after testing, of course) so that the world can enjoy your search plugin.
Check out the end result on my Projects page or go straight to the plugin on Mozilla.





