Giter Club home page Giter Club logo

ggl's Introduction

ggl

Google Custom Search for the command line. The results are displayed with Curses. The application takes you directly to the resulting page.

Usage

git clone [email protected]/pimms/ggl && cd ggl

sudo ./install.sh

ggl i am now searching the web

Unsure

Dependencies

The dependencies for GGL can be installed via PIP. This may not be the extensive list of external dependencies.

$ sudo pip install google-api-python-client curses

GGL uses Google's Custom Search API which only gives you one hundred free searches per day. You have to create a new application on the Google Developer Console and enable the Custom Search API for this application.

To create an API key

Creating your own API key is unfortunately absolutely required as there is a limit of 100 daily searches for free per API key, and I plan on using all of mine :) If you want more, the price is $5 for every thousand searches beyond the initial 100. Creating the API key takes roughly 3 minutes.

  1. Go to https://cloud.google.com/console/project and create a new project
  2. Click on your newly created project and in the left pane click "APIs and Auth"
  3. Find the Custom Search API and click the button to enable it
  4. In the left pane, click on the "Credentials" item
  5. Click "Create New Key" under the Public API Access pane. Select "Browser Application" and leave the text field empty.
  6. Your newly created API key can now be used with GGL (or anything else)

To create a custom search engine

The default Search Engine ID is configured exactly as written above, but create your own if you want to customize your results even more.

  1. Go to https://www.google.com/cse/ and click the "Add" button
  2. In the "Sites to Search" field, enter any URL - YOU WILL REMOVE IT LATER!
  3. Click "Create", and on the next page click the "Control Panel" button
  4. Change the "Sites to Search" option to "Search the entire web..." and remove the URL you added in step 2
  5. From the control panel, click the "Get Code" button. Your Search Engine ID can be found on line 3 of the JS snippet.

Configure your stuff

The configuration file contains some fields which must, and some which should be configured by you.

#####[api] api_key (REQUIRED) The API-key created in the Google Developer Console

#####[api] search_engine (REQUIRED) The ID of the CSE created as described above, or use the default value (mine).

#####[cmd] open_url_cmd (REQUIRED) The command that will be used to open the URL retrieved from Google. Defaults go gnome-open. The URL is passed as the sole parameter to the application.

#####[cmd] cmd_out_redirect Where to redirect the output (STDOUT and STDERR) from open_url_cmd and post_cmd.

#####[cmd] post_cmd Command that is executed after the URL has been opened. Should be used to give your browser focus. This option is extremely awesome with the i3 WM if you always have your browser in the same workspace. If your browser is opened in workspace 2: post_cmd: i3 workspace2.

ggl's People

Contributors

pimms avatar

Stargazers

Arbal avatar Ben Yellin avatar Alexander Knorr avatar Leonardo Vaz avatar Nazeeruddin Ikram avatar Martin Sjåstad avatar Chauncey Garrett avatar Drew Keller avatar Travis Grammer avatar Frank Geerlings avatar Casey R Hickerson avatar Protopropanol avatar Jorge Santiago avatar GyuYong Jung avatar swein avatar Xiaodong Xu avatar Ryan Richards avatar  avatar  avatar bohoomil avatar Sören Gade avatar Thomas Ingham avatar confluencepoint avatar  avatar

Watchers

James Cloos avatar Michele Venturi avatar Marcus Rosenow avatar

Forkers

semtle

ggl's Issues

Support ÆØÅ-input

Having Æ, Ø or Å in the search string crashes GGL. This probably goes for most accented characters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.