Jump to content

Google Suggest not working when no suggestions available.


Recommended Posts

I just upgraded to Monterey. I also just deleted v1.0 of the Google Suggest workflow that I had previously installed and, using the example workflow, installed Google Suggest v1.2.

 

Unfortunately this version of the workflow is not working for me when no suggestions are returned. Previously, when no suggestions were found, the workflow just fed the entire string to a Google Search in Safari. Now nothing happens. 

 

Is it possible to get that previous functionality back? If there are no suggestions, I want to go straight to Google.com with those search terms. What am I missing?

Link to comment
5 hours ago, HeatherH said:

Is it possible to get that previous functionality back?

 

Yes.

 

5 hours ago, HeatherH said:

What am I missing?

 

If memory serves, when the previous versions didn’t get a match they wouldn’t allow searching for the current query and would instead return nothing. Except if you use Fallback Searches, you might be seeing those anyway. But because I tried to be helpful and present a “no results” message when nothing matched, it counts as a result thus the Fallback Searches aren’t triggered.

 

Either way, doesn’t matter. What matters is we can get the best of both worlds by making it search for your query when no results are found. Download the new versions for a quick fix back to your preferred behaviour. I’ll send these to @Vero too.

Link to comment
  • 1 month later...

I ran into the same problem, How should I make it work?

 

ERROR: Google Suggest[Script Filter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `initialize': execution expired (Net::OpenTimeout)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `block in connect'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:103:in `timeout'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:945:in `connect'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:919:in `start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:605:in `start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:481:in `get_response'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:458:in `get'

 

Link to comment
1 hour ago, Junhong said:

I ran into the same problem


That’s not the same problem, that’s a connectivity issue. Either your connection or the API had a hiccup.

 

I just checked and it’s working fine now. Make sure you’re on version 1.4 of the Workflow and restart.

Link to comment
5 hours ago, vitor said:


That’s not the same problem, that’s a connectivity issue. Either your connection or the API had a hiccup.

 

I just checked and it’s working fine now. Make sure you’re on version 1.4 of the Workflow and restart.

 

Where can I download version 1.4 of this workflow? I see that I am using version 1.1 of Google Suggest workflow

Snipaste_2021-12-03_21-47-11.png

Link to comment
22 minutes ago, Vero said:

@Junhong In Alfred's Workflows preferences, you can delete the version you're using and re-add from the built-in workflows (by clicking the [+] at the bottom > Examples > Google Suggest)

Thanks, As you said, I downloaded the 1.4 version of the workflow, but my Google Suggest workflow still doesn’t work, The error log is as follows.Amazon Suggest workflow can work normally.

[{"uid":"2021-12-03 22:26:40 +0800 no","title":"no","subtitle":"Search “no” on Google","arg":"no"}]}
[22:26:40.205] Google Suggest[Script Filter] Queuing argument 'no'
[22:27:40.291] Google Suggest[Script Filter] Script with argv 'no' finished
[22:27:40.296] ERROR: Google Suggest[Script Filter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `initialize': execution expired (Net::OpenTimeout)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:947:in `block in connect'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:103:in `timeout'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:945:in `connect'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:919:in `start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:605:in `start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:481:in `get_response'

 

Link to comment
21 minutes ago, Junhong said:

Amazon Suggest workflow can work normally.

 

That’s an important clue. Both Workflows are essentially the same; what differs is the API they access.

 

23 minutes ago, Junhong said:
Net::OpenTimeout

 

That means your connection is too slow to access the API, likely blocked. Something on your machine, such as a VPN or firewall (e.g. LittleSnitch), is preventing the network request.


What’s the result if you open a terminal and run curl 'https://suggestqueries.google.com/complete/search?output=firefox&q=test'?

Link to comment
10 hours ago, vitor said:

What’s the result if you open a terminal and run curl 'https://suggestqueries.google.com/complete/search?output=firefox&q=test'?

The results of run curl'https://suggestqueries.google.com/complete/search?output=firefox&q=test' are as follows.

curl: (28) Failed to connect to suggestqueries.google.com port 443: Operation timed out

But I can access the above URL, and will return a txt file, as shown below.

["test",["test","testflight","testflight邀请码","testnet","testflight邀请码大全","testosterone","testflight vpn邀请码","testv","testflight应用","test your vocabulary"],[],{"google:suggestsubtypes":[[512],[512],[512],[512],[512],[512],[512],[512],[512],[512]]}]

How should I fix this problem?

Link to comment
1 hour ago, Junhong said:

How should I fix this problem?


As I said:

 

12 hours ago, vitor said:

Something on your machine, such as a VPN or firewall (e.g. LittleSnitch), is preventing the network request.


You need to figure out what it is. What’s certain is there’s something in your setup that is affecting at a deeper level; it’s not related to Alfred or the Workflow. Searching for the curl error online will yield clues. Also, try rerunning the command with --verbose appended, as that will show more information to search for.

 

From your Ruby version, it doesn’t seem like you’re on the latest macOS. Old software could be the culprit, and you can’t easily solve it without an upgrade.

Link to comment
10 hours ago, vitor said:

From your Ruby version, it doesn’t seem like you’re on the latest macOS. Old software could be the culprit, and you can’t easily solve it without an upgrade.

@vitor I am using the latest version of MacOS Monterey 12.0.1. Does my version of Ruby need to be upgraded?

I seem to have found the problem. As you said, I did use a VPN, which occupies my 7890 port. With the help of VPN, I can get back results.

curl -I --socks5 127.0.0.1:7890 'https://suggestqueries.google.com/complete/search?output=firefox&q=test'

I ran the above command in the terminal and it returned as follows.

HTTP/2 200
content-type: text/html; charset=ISO-8859-1
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
date: Sat, 04 Dec 2021 13:36:44 GMT
server: gws
x-xss-protection: 0
x-frame-options: SAMEORIGIN
expires: Sat, 04 Dec 2021 13:36:44 GMT
cache-control: private
set-cookie: CONSENT=PENDING+882; expires=Mon, 04-Dec-2023 13:36:44 GMT; path=/; domain=.google.com; Secure
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

Through the above verification, how should I modify the workflow to make it initiate a request to https://suggestqueries.google.com through my VPN?

 

Link to comment
5 hours ago, deanishe said:

What does "access" mean? Open in your browser? Is your browser configured to use a proxy server?

@deanishe Yes, I can open https://suggestqueries.google.com through the browser, but ping https://suggestqueries.google.com in the terminal fails because my browser is configured to use a VPN server.

How should I modify this workflow so that it also sends a request to https://suggestqueries.google.com through my VPN?

Link to comment
44 minutes ago, deanishe said:

If you correctly configure your SOCKS proxy in Alfred Preferences > Advanced > Network, I believe Ruby workflows like this one will automatically use it.

@deanishe Is it the right configuration like the picture below, but it doesn't seem to achieve the desired effect. I can confirm that my VPN is an HTTP proxy and the port number is correct.

google.png.png.298d32013dbad6beb20b941b01629d78.png

Edited by Junhong
Link to comment
4 hours ago, Junhong said:

I can confirm that my VPN is an HTTP proxy and the port number is correct.

 

A VPN is not an HTTP proxy. They're very different things. And a SOCKS proxy, which is how you used your proxy with curl in your earlier post, is another thing again.

 

If it really is a SOCKS proxy, the correct value for http_proxy would be socks5://127.0.0.1:7890

Link to comment

I've been looking into it, and it appears that Ruby does not support SOCKS proxies. At least not for HTTP(S) requests.

 

I think you'll have to look for a different workflow, or use an actual VPN, so all your outbound network traffic is routed via the server.

Link to comment

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