Jump to content

Alfred2 workflow for google search suggestion, instant search, and current site search


Recommended Posts

Posted (edited)

The initial motive is to automatically use current front browser's site for site search. Current it includes google suggestion, instant search, site search and related search.

 

Suggestions are welcome.

 

Check it out in Github: http://zhaocai.github.com/alfred2-google-workflow/

 

 

It is also an example to use bundler to include gems in an alfred workflow. The command is bundle install --standalone.

workflow.png

Usage 1. Search Suggestion

Keyword g: provide google search suggestions based on {query}.

2. Instant Search

Keyword gi: get instant google search results in Alfred based on {query}.

3. Site Search

Keyword gs: get instant google search results of front browser's site in Alfred based on {query}.

Supported browsers are: Safari, Google Chrome, Opera, OmniWeb, etc.

You can use site:example.com query if you do not want to search for current front browser's site.

4. Related Search

Keyword related: get related google search results of front browser's site in Alfred based on {query}.

Supported browsers are: Safari, Google Chrome, Opera, OmniWeb, etc.

You can use related:example.com query if you do not want to search for current front browser's site.

Installation

Two ways are provided:

  1. You can download the Google.alfredworkflow and import to Alfred 2. This method is suitable for regular users.

  2. You can git clone or fork this repository and use rake install and rake uninstall to install. This method create a symlink to the alfred workflow directory: "~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows". This method is suitable for developers.

Reference

  1. Site Search Workflow for Alfred 2
  2. Google Search in-line results workflow
Edited by zhaowu
Posted

Sorry, did not notice an extra dot in the link. It is fixed now.

Link is broken and sounds like a workflow I'd really like to have. If you can fix I'd appreciate it! Thanks!

Posted

Just WOW!

I love your workflow!

Thank you for sharing!

 

You should definetely submit your workflow to

http://www.alfredworkflow.com/

 

 

Would it be much work to change the Instant Search to google.de?

That would be so great!

 

Domenic

change the Instant Search to google.de should be easy. You just need to change the line in the `instant.rb` file

 

`    :arg      => URI.escape("http://www.google.com/search?as_q=#{query}&lr=lang_")`

http://www.google.com -> http://www.google.de

 

I am working on some updates. will upload this later. 

Posted

thanks! "gs" and "gi" are awesome!! 

 

one problem: when searching for my company ($300 Data Recovery) it seems to have issues with the "$." 

Posted

fixed. please update. 

thanks! "gs" and "gi" are awesome!! 

 

one problem: when searching for my company ($300 Data Recovery) it seems to have issues with the "$." 

  • 4 weeks later...
  • 2 weeks later...
Posted (edited)

This is a great workflow though it doesn't appear to work with Firefox, any chance of adding support? (I'm using FF Aurora 22.0a2)

Edited by BrianGilbert_
Posted

This is a great workflow though it doesn't appear to work with Firefox, any chance of adding support? (I'm using FF Aurora 22.0a2)

Firefox does not support applescript. I do not know a good way to get the tab url from it.

  • 3 weeks later...
  • 4 months later...
Posted

Hi

 

I installed the latest version from github, but Google Instant Search "gi" doesn't work, it just falls back to my normal google search.

 

Any ideas?

Posted

try to run the script `/usr/bin/ruby ./instant.rb {query}` from the command line and check the output.

 

Also check the log: ~/Library/Logs/Alfred-Workflow.log

Posted

try to run the script `/usr/bin/ruby ./instant.rb {query}` from the command line and check the output.

 

Also check the log: ~/Library/Logs/Alfred-Workflow.log

It seems to be a Ruby error (I'm using 10.9 GM). This is the error when running from command line:

/usr/bin/ruby /Users/martin/Dropbox/Alfred_v2/Alfred.alfredpreferences/workflows/user.workflow.FD7614C1-3388-4F55-885A-5C04C0B50D3F/instant.rb test
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- alfred (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/martin/Dropbox/Alfred_v2/Alfred.alfredpreferences/workflows/user.workflow.FD7614C1-3388-4F55-885A-5C04C0B50D3F/instant.rb:20:in `<main>'

Any ideas on how to fix it?

 

Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...