UNData Firefox Plug-in
I wrote my first plug-in today for my Firefox search bar! This may be pretty remedial coding but I am feeling proud of myself nevertheless.
I wanted to have the ability to search terms directly on the new UN search engine, UNdata. I talked about this site on today’s episode of Loaded. After we filmed the show, I got to thinking that it would be really useful to have easy access to the site in my search bar so I decided to write a plug-in.
I realize I could have used the Add To Search Bar plug-in to make this job easier but I wanted to write the code myself for educational purposes. I also wanted to share it with the community so that I can say that I’ve written open source code because Wilson Tang told me that only one in 50 open source coders is a woman. That’s not enough!
I’ll admit, I didn’t do this on my own. I was able to make the plug-in by myself but I had trouble making it execute the search. Wilson and Randall Bennett from The 404 helped me out with that line of code. Thanks guys!
I am going to send this code to Mozilla so that they can share it but I also thought I would share it with you here. I hope it works!
<SearchPlugin xmlns="http://www.mozilla.org/2006/
browser/search/" xmlns:os="http://a9.com/-/spec/
opensearch/1.1/
">
<os:ShortName>UNData</os:ShortName>
<os:Description>UNData</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16"
height="16">data:image/x-
icon;base64,
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAA
AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP38/
AH48vAV+fTyFP39/AH///8A9/HvGe3b1kjx5OAz////AP///wD///8A
////AP///wD///8A+fX0FOLGvGvSpZenw4d028GEceDRo5Wt5crCZOr
W0E327+0e////AP///wD///8A////AP///wD///8A////
AOrUzlfMmIi7yJOCx9y5rov06uco9u/sHP37+wP///8A////AP///
wD///8A////AP///wD///8A/fz8A+XLw2fEiXbZ37+0gcOJd9v16+gu
////AP///wD///8A////AP///wD///8A////AP///wD///8A////
APn08hjOn4+506iardatoKXWrqKh/f39Af///wD///8A////AP///wD///
8A////AP///wD///8A////AP37+wbTqZqr3LqvidKnmK7jxr14/
Pr6B96/tXHGkH7JyJOCwtSqnZn8+/sD5c3FV9Opm5v///
8A69nTQsiTgsL27+wk16+jm967sIfVq56j+vf2FP///
wC4c1z92LOniebQyFS4dF396tbQSN/AtnDFjnvN
+vf2DMmWhL+4c1z9+PLwHNCik7bLmIfF69bQVP///wD///
8AuHRd/e7e2Tr8+voGwYVx3eHFu2fgw7pqy5qJturW0Ei5dl/4uXVe
+uvWz1zWraCl4sS6eOfOx2L///8A////ALl1Xvrs2tU/
+vb1DsCEcN7ix75k4ca8ZcSLeNPDiXbV1a6gk7+CbePx498/z5
+Qu9myppv59PMV////AP///wC4c1z969jSRPr29Q6
+f2rp4MO6auLIv2K4c1z9voBr5/Ln4yq7emTw7NrVUNGklbPZtKiZ8uPfNf
///wD///8Ay5qJtvDj3zD7+PcK0KSVpenVzkrq19FGyJOCwuTLw1z7
+fgHzp6PrvHk4DLat6uTyJOBzeG/tnj///8A////AP///wD///8A
////AP///wD///8A////AP///wD///8A////AP///wD///
8A5czEYtOomqfQopSz6dXOV////wD///8A////AP///wD///
8A////AP///wD///8A////AP///wD///8A////
APfx7xnQopOu0aKTs86ejr3v4NtC////AP///wD///8A////AP///
wD///8A////AP///wD///8A////AP///wD///
8A+fTyFePHv3XTqJqzzJuLwfPo5Dj///8A////
AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///
wD///8A9OvoLvPo5DPo0sxc/fz7Bv///wD///8A////AP///
wD///8A////AP///wD///8A//8AAPh/AADx/wAA4/8AAMP/
AACONgAAjLQAAJ20AAC9sAAAnbIAAJ22AACf/
wAAz/8AAMf/AADz/wAA//8AAA==</os:Image>
<SearchForm>http://data.un.org/Default:Search.aspx<
/SearchForm>
<os:Url type="text/html" method="GET"
template="http://data.un.org/Search.aspx?q={searchTerms}
">
</os:Url>
</SearchPlugin>
Update: Oh right, what do you do with this code. Sorry! If you are using a Mac, save it as an XML file here:
Library>Application Support>Firefox>Profiles>searchplugins
Once you do that, you’ll have to restart your browser and it should work.
If you’re using a PC, I believe you add it to your Firefox folder in your applications. I haven’t used a PC in a long time so I’m sorry if that is incomplete. Any PC users want to set me straight?
-
Mike
-
Bonbon
-
update your myspace
-
Nessa
-
sunsnapper
-
Sam R
-
Kevin
-
Kevin