Google Search in your command line, then copy a search result link to your clipboard (OS X, Linux, Win)
Ruby
Pull request Compare This branch is 6 commits ahead, 1 commit behind Kerrick:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
screenshots
spec
.gitignore
.gitmodules
.rspec
Gemfile
Gemfile.lock
Guardfile
LICENSE.md
README.md
Rakefile
TODO.txt
google.gemspec

README.md

google-copy-link

The CLI displays results from the Google Web Search API, allows you to page through the results, and choose a url to copy to your clipboard, all without leaving the command line.

Screenshot of goo in action!

Installation

gem install google-copy-link # Requires Ruby 1.9

Usage Examples

Typing goo --help will list all the available commands. They are also listed here.

The goo gem is a simple tool to search Gooogle and copy a search result link to your clipboard.
Usage:
    goo [options] "my search query string here"
where [options] are:
      --markdown, -m:     Use markdown format when copying link to clipboard. Example: \[Trollop\]\(http://trollop.rubyforge.org/\) (Default: false)
        --page, -p <i>:   Start by showing the <i>th result page. (Default: 1)
        --size, -s <i>:   Show <i> results on each SERP. Must be between 1 and 8. (Default: 4)
      --result, -r <i>:   Skip the SERP and show the <i>th result.
            --help, -h:   Show this information and exit.

At the prompt, type the index of a search result, it will be copied to your clipboard.

If you press , the first search result link will be copied.

ONLY TESTED with a mac. Should work on linux and windows thanks to clipboard gem;)

When writing blog posts in Markdown or looking for libraries in google, I became tired to repeat the whole manual search process in the browser so I found a way to automate it;)

Search on a single site

goo 'site:randsinrepose.com NADD'

Features

  • You have access to all the search operators you've come to know and love in Google Search.

  • Results are shown in markdown for a good balance between legibility and document heirarchy. (Shoutout to reverse_markdown!)

  • Results pages are formatted to look like a Google SERP, including colors, domains, descriptions, and bold search matches. (Shoutout to formatador!)

Supported Ruby Versions

This library has only been tested against Ruby 1.9.3. Other versions might be supported, but they haven't been tested.

Acknowledgements

Most of the code is a fork of Kerrick Long. See LICENSE for details.

This gem is Powered by Google.

Copyright

Copyright (c) 2012 Jean-Michel Garnier. See LICENSE for details.

Dependencies