Jump to content
zhaowu

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

Recommended Posts

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

Share this post


Link to post

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!

Share this post


Link to post

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. 

Share this post


Link to post

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

 

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

Share this post


Link to post

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 "$." 

Share this post


Link to post

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_

Share this post


Link to post

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.

Share this post


Link to post

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?

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...