Jump to content
aviaryan

[Alfred 3] Google Inline Search (open URL + copy to clipboard)

Recommended Posts

This workflow allows you to do inline Google searches right from the Alfred bar. You can either open the result URL or copy it to clipboard. Please go to GitHub for documentation

 

GitHub: https://github.com/aviaryan/alfred-google-search

Download: https://github.com/aviaryan/alfred-google-search/raw/master/Google Search.alfredworkflow

 

Screenshots

Default UI

Search 1

Unicode

 

 

 

Edited by aviaryan

Share this post


Link to post
1 hour ago, deanishe said:

The whole "$ to copy URL" is unnecessary: just hit ⌘C on a result to copy the URL.

Thanks. Didn't know about that. 

I have updated the workflow to incorporate this change.

 

Share this post


Link to post

Yeah. If nothing is selected in the query box, and you haven't set a "copy text" for an item, ⌘C copies the selected item's arg.

 

BTW: You might want to add a copy of the .alfredworkflow file to your releases on GitHub. People generally expect to find the installable files in releases.

Edited by deanishe

Share this post


Link to post
2 hours ago, deanishe said:

Yeah. If nothing is selected in the query box, and you haven't set a "copy text" for an item, ⌘C copies the selected item's arg.

1

Cool. I didn't know we had a copy text parameter. Any place where I can find all this documented?

 

2 hours ago, deanishe said:Yeah. If nothing is selected in the query box, and you haven't set a "copy text" for an item, ⌘C copies the selected item's arg.

BTW: You might want to add a copy of the .alfredworkflow file to your releases on GitHub. People generally expect to find the installable files in releases.

Yes. I had been including the binary in the releases in my previous 2 workflows. Just got a bit lazy this time. I have added it now. 

Share this post


Link to post
9 minutes ago, aviaryan said:

Any place where I can find all this documented?

 

https://www.alfredapp.com/help/workflows/inputs/script-filter/json/

 

See the "text" section. Also the example workflow you can add via Alfred Preferences > Workflows > + > Getting Started > Script Filter shows most of what you can do (it doesn't demonstrate rerun or variables).

Share this post


Link to post
18 hours ago, bazerman said:

Anyone using this successfully with Alfred 4?

 

It works for me, but with this important caveat:

 

Quote

Overusing this workflow might lead to your IP being blocked by Google Search servers. Searches through Chrome or another browser might still work but this workflow will stop working. I recommend keeping a 10-15 seconds gap after each usage of this workflow. In most cases, much lower gaps or even continuous use of the workflow will still work but still this is something to be kept in mind. If you see a 'rate limit' or a 503 error, it's best to stop using the workflow and try back after some time (~1 minute).

 

The rate limit makes the workflow unfeasible for my routine.

Share this post


Link to post
1 hour ago, xilopaint said:

Really? This workflow worked for me.

 

For me, Google isn't sending the HTML markup the workflow expects. This parser is looking for the same tags as the other workflow's.

 

The problem is that Google doesn't give everybody the same HTML, or the same person the same HTML at different times. Changing the user agent can get you a completely different page.

 

I suspect such a workflow might have more luck with a user agent like Lynx/2.8.5dev.16 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7a. That gets you a really old-school version of the page that hasn't changed in 15 years (and probably won't change).

 

Share this post


Link to post

I used to use a few different modified versions of this workflow, to return results for specific sites (prefix site:site.com). It was indispensable, but now, I am definitely rate-limited / blocked, and I can't seem to get it to work anymore, even from different IP addresses. 

 

Does anyone have a recommendation for where to begin on replacing such functionality? I tried modifying @deanishe's Searchio! workflow, but I think the suggest URL doesn't work after adding in my site: prefix. 

 

 

Share this post


Link to post
10 minutes ago, joeynotjoe said:

but I think the suggest URL doesn't work after adding in my site: prefix

 

In theory, you could edit the search URL for the results page to add your site:xyz.com, but you can't have suggestions for a specific site. And anyway, it only provides suggestions, not results like this workflow does.

 

13 minutes ago, joeynotjoe said:

I can't seem to get it to work anymore, even from different IP addresses

 

That probably won't help. Google seems to have changed the HTML of the results page (for some users at least).

Share this post


Link to post
Posted (edited)

Ah you are right, thanks for pointing that out. I missed the fundamental distinction between results and suggestions. So essentially, this workflow will need to be refactored to support the new HTML results if that's possible, otherwise, go back to the dark ages of opening the results page before going to what I want :). 

Thanks for the quick response!  

Edited by joeynotjoe
typo

Share this post


Link to post
3 hours ago, joeynotjoe said:

So essentially, this workflow will need to be refactored to support the new HTML results if that's possible

 

Yup. It’s pretty normal to have to fix HTML parsers often. Webpages change a lot.

Share this post


Link to post
23 hours ago, joeynotjoe said:

this workflow will need to be refactored to support the new HTML results if that's possible, otherwise, go back to the dark ages of opening the results page before going to what I want :). 

 

🤞️ - was one of my favourites! Huge timesaver

Share this post


Link to post
Posted (edited)

I am still so gutted about this - anyone found any alternatives? As a non developer, what would be the learning curve like if I was to take this on myself and try to fix the HTML parsers?

Edited by bazerman

Share this post


Link to post

@vitor - Searchio! is great, but the main difference was, as far as I can tell, actioning the searchio 'results' takes you to the google results page, whereas actioning this workflow's results actually took you to the result's URL.

 

aviaryan's workflow's results:

68747470733a2f2f692e696d6775722e636f6d2f

Searchio's results:

iWFiAnI.png

So, the original workflow from this thread is 'better' if you know what you're looking for - it saves you the step of going to the google page.

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