googler 2.3 adds Google Site Search

googler

I have released googler 2.3 yesterday. As most TuxDiary readers are aware by now, it is a utility to google from the cmdline. The latest version extends that further by adding Google Site Search support so that you can search a single website using Google. googler users can now lookup Amazon for shopping or IMDB to check out how The Jungle Book is doing in the Box Office! Continue reading googler 2.3 adds Google Site Search

cli-google: google search from terminal

Who wants to leave the comfort of the terminal and open a browser to search Google? 😉 We explored several ways to search google in our earlier articles (GoogleCL, Surfraw). How about some cool utilities that do not need much setup or learning? I revived one myself. Continue reading cli-google: google search from terminal

Surfraw: web search from terminal

           ______  _     _  ______   _______  ______   _______  _  _  _
          / _____)(_)   (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_)
         ( (____   _     _  _____) ) _____    _____) ) _______  _  _  _
          \____ \ | |   | ||  __  / |  ___)  |  __  / |  ___  || || || |
          _____) )| |___| || |  \ \ | |      | |  \ \ | |   | || || || |
         (______/  \_____/ |_|   |_||_|      |_|   |_||_|   |_| \_____/

You might have heard the allegations about search giants recording your data or tracking it. And you might have heard about Julian Assange. Would it be surprising to know that Assange wrote a cmdline perl based tool to search Google (and many other web services) at lightning speed… a tool sans the tracking? I guess not.

Such a tool exists, written in 2000. It’s Surfraw.

Each supported search engine or database (like Google, Wikipedia, Slashdot etc.) is called an elvi in Surflaw, apparently as a tribute to Elvis (Ref: Wikipedia).

Features

  • Search tons of websites in addition to Google. To get the full list
    $ surfraw -elvi
  • Supports bookmarks
  • Supports bash completion (elvi names, options, arguments) using <Tab>
  • Use Google Translate, images, news, mps, video etc.
  • Supports safe search filter
  • Works best with text-based browsers like links, lynx, w3m

Installation

To install Surfraw on Ubuntu, run:

$ sudo apt-get install surfraw surfraw-extra

Configuration

The user-specific configuration file is ~/.surfraw.conf. The syntax is simple – defyn is used for boolean configuration variables, def for all others. Example configuration:

def SURFRAW_text_browser      /usr/bin/lynx
defyn SURFRAW_graphical       yes
def SURFRAW_graphical_browser firefox
def SURFRAW_results           10
def SURFRAW_lang              uk

Usage

Surfraw has many options, many of them specific to the elvi (search service). If you do not want to type surfraw all the time, sue the alias sr.

  • The general syntax
    sr elviname [options] search terms..
  • Search Google with multiple terms and limit results to 100
    $ sr google -results=100 foo "bar baz" bam
  • Search Wikipedia
    $ sr wikipedia surfraw
  • Search a phrase
    $ sr austlii -method=phrase dog like
  • Get a rhyming word
    $ surfraw rhyme Julian
  • Search a RFC about mime
    $ sr rfc s/mime
  • Translate a word
    $ sr translate logiciel

Webpage: Surfraw (with love, from Julian Assange)

GoogleCL: Google services from cmdline

google_compGoogleCL is a handy way to access many of Google services from the terminal that console addicts are going to love. The currently supported services (with example usage) are:

  • Blogger
    $ google blogger post --title "foo" "cmdline posting"
  • Calendar
    $ google calendar add "Lunch with Jim at noon tomorrow"
  • Contacts
    $ google contacts list Bob --fields name,email > the_bobs.csv
  • Docs
    $ google docs edit "Shopping list"
  • Finance
    $ google finance create-txn "Savings Portfolio" NASDAQ:GOOG Buy
  • Picasa
    $ google picasa create "Cat Photos" ~/photos/cats/*.jpg
  • Youtube
    $ google youtube post --category Education killer_robots.avi

The developers provide a manual and example scripts with more common examples of how to use the utility. Packages are available for Debian based Linux platforms and Windows. Find the instructions to install from source code here.

Webpage: GoogleCL