Entries tagged “firefox”

PyPI opensearch plugin for Firefox

written by ccomb, on Jan 5, 2008 1:13:00 PM.

To be able to search PyPI (the Python Package Index) directly from your browser, click on this link and follow the simple instructions :

PyPI firefox search plugin

An opensearch plugin is just a simple xml file :

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Python Package Index</ShortName>
<Description>Search packages on PyPI</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACAQAAAgEBrDkxBwAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGaSURBVDiNjZM/SFZRGIcfPy8EgRF8TRGGgzg1RFK21NBmkA4RSDnUkLS0tFk05djSELQ0CG0FKdESBv0ZKoIGl8yhkGiLoiKIOs+vwU+9XT6lAxfOeXme3zn3cN6eJNTHyJUHA+hVUoaJe9FfpCwnPiHOvLx+5kedr2gOvU3KIrFC+0jpS9xFPIzuASa3DkgZIH5Hd5JCIkRQSBlu4l0CvIO2SZnryFMdGWJP14CR6flpUsaJO9bgxs4b86XRm+gp9CHxfDUyPX+RlJk6vKkc/6DbiW3iJLrSImWsBmwlQ8orYj92anqsIu7bkNeFZVI+1eRCypt7Zx49Re+uB8TBCm3V5N9D7S8nZycWjqD70d4O2IueQC/VZFAr4nJS2p3C89mJx+OYsw2Qf9YbtcVWUhZq/7yCHlydZ/UzbBqmcxXxGtpPyijxJ6unqkNLuBa2XvtGvM+hFzd6mr3Au+Nv0aHarrdq4mcOPLtcx1tdeiGNI0+hY+hu4ukm3i3gdeOiQL8SP6Dv/6cXLqAf0aPoILqt8wL70HNN/C9qLLqMai/4aQAAAABJRU5ErkJggg==</Image>
<Url type="text/html" method="get" template="http://pypi.python.org/pypi">
  <Param name="%3Aaction" value="search"/>
  <Param name="term" value="{searchTerms}"/>
  <Param name="submit" value="search"/>
</Url>
<moz:SearchForm>http://pypi.python.org/pypi</moz:SearchForm>
</OpenSearchDescription>

The Python logo is encoded (base64) in the xml file

Finally the "add Python Package Index" suggestion in your search plugin list is obtained by linking to the xml file this way:

<link rel="search" type="application/opensearchdescription+xml" title="Python Package Index" href="http://ccomb.gorfou.fr/static/pypi/pypi.xml" />

test