Tuesday, March 20, 2018

Adding a Custom search URL to your firefox browser

It is a very common that we have a website which we enter a search term regularly to get response back. Instead of going to website and use its search feature, we can directly route that search to website via FF search.

So, how to make that work?

First read up on the link here which details the process : https://developer.mozilla.org/en-US/docs/Talk%3ACreating_OpenSearch_plugins_for_Firefox

Then create two files one .htm and another .xml . You open the .htm file in browser and the search icon changes with a +, indication a search engine is available on website to be added to browser.

Now ,if the files are on you local laptop, the url localhost won't work, Also, FF blocks file:/// urls, so what to do?  Simplest way it to run a local webserver, you can do it variety of way, one of way is to just run  local webserver from the directory where these files are contained: Example using python:

python -m SimpleHTTPServer
(for v3) python -m http.server [<portNo>]


Example of .htm

<html>
    <head>
        <link rel="search"
      type="application/opensearchdescription+xml"
      title="YOURWEBSITE"
      href="http://localhost:8000/YOURWEBSITE.xml">
        YOURWEBSITE
        </link>
    </head>
</html

Example of .xml; replace with your own URL, and customize accordingly.

<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
     <ShortName>YOURWEBSITE</ShortName>
     <Description>YOURWEBSITE)</Description>
     <Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAOMAAAAAABgYtRgYrRgYlBBSMcaEMQhKKTFaKcZ7Mb17MRBKKYxzKQAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARGEMhAq7y36iBwphjXhaAnnKR3DUOqAqyrxt8Lt18w05fAYawBQeULBguGA9E4MCASB4XtYnAuDsopoJqASrVVBMKglVSrEQA7</Image>
     <InputEncoding>UTF-8</InputEncoding>
     <Url type="text/html" method="get" template="https://YOURWEBSITE.com/xyzurl/name?searchName={searchTerms}"/>
</OpenSearchDescription>



That's it to it you got your search engine available on FF. Enjoy!

Saturday, February 24, 2018

Getting Started with graphing utilities

In this post we look at few graphing utilities which would help us in rendering graphs (charts) simply. Few of the tools I researched are discussed here.
I'm still looking out for a good tool to have these charts zoom in/out and ability to focus in on small time periods. Let me know if you know ?

Python - Pygal

Pygal is a really good utility to generate graphs in svg or png with default rendering being good enough.

Built a tutorial youtube video on this which can be used to get going on this tool.

The code files for that same video can be found here on GitHub

 

 Python – MatPlotLib & Mpld3


 This is a also a powerful tool to render graphs. Mpld3 is used to get the rendering for browsers and clean up the default rendering by matplot library. By default didn't like rendering as much as pygal above.

Built a tutorial youtube video on this which can be used to get going on this tool.

The code files for that same video can be found here on GitHub

 

GnuPlot

This cool tool allows a powerful rendering of charts without much coding at all. Mostly configuration needs to happen and it can read data files on its own and render graphs for you. Very powerful in its own right and really good rendering.


Built a tutorial youtube video on this which can be used to get going on this tool.

The code files for that same video can be found here on GitHub