aviaryan Posted September 7, 2017 Posted September 7, 2017 (edited) 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 Edited September 7, 2017 by aviaryan multicolor and aashutoshrathi 2
deanishe Posted September 7, 2017 Posted September 7, 2017 The whole "$ to copy URL" is unnecessary: just hit ⌘C on a result to copy the URL. aviaryan 1
aviaryan Posted September 7, 2017 Author Posted September 7, 2017 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.
deanishe Posted September 7, 2017 Posted September 7, 2017 (edited) 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 September 7, 2017 by deanishe aviaryan 1
aviaryan Posted September 7, 2017 Author Posted September 7, 2017 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.
deanishe Posted September 7, 2017 Posted September 7, 2017 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). aviaryan 1
multicolor Posted November 7, 2017 Posted November 7, 2017 Love it! So useful to look up quick things, like "gs 720p def" and then use shift to preview the first page, way faster than using a browser. Way to go!
Skone Posted May 31, 2019 Posted May 31, 2019 Anyone using this successfully with Alfred 4? Seems to have the same problem as ethan-funny's workflow:
xilopaint Posted June 1, 2019 Posted June 1, 2019 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.
deanishe Posted June 1, 2019 Posted June 1, 2019 19 hours ago, bazerman said: Anyone using this successfully with Alfred 4? Seems to have the same problem as ethan-funny's workflow: It has exactly the same problem. Google isn't returning the HTML the workflow expects. And this one's a real mess to fix. One simply does not use regular expressions to parse HTML.
xilopaint Posted June 1, 2019 Posted June 1, 2019 1 hour ago, deanishe said: It has exactly the same problem. Google isn't returning the HTML the workflow expects. And this one's a real mess to fix. One simply does not use regular expressions to parse HTML. Really? This workflow worked for me.
deanishe Posted June 1, 2019 Posted June 1, 2019 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).
joeynotjoe Posted June 1, 2019 Posted June 1, 2019 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.
deanishe Posted June 1, 2019 Posted June 1, 2019 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).
joeynotjoe Posted June 1, 2019 Posted June 1, 2019 (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 June 1, 2019 by joeynotjoe typo
deanishe Posted June 1, 2019 Posted June 1, 2019 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. joeynotjoe 1
Skone Posted June 2, 2019 Posted June 2, 2019 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
Skone Posted July 4, 2019 Posted July 4, 2019 (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 July 5, 2019 by bazerman JJJJ 1
Briscoe Posted November 29, 2019 Posted November 29, 2019 Curious if anyone was able to find an alternative to this that works in Alfred 4 🙂
vitor Posted November 30, 2019 Posted November 30, 2019 Doesn’t @deanishe’s Searchio! do the same (and more) as this Workflow?
joeynotjoe Posted November 30, 2019 Posted November 30, 2019 @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: Searchio's results: 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. vitor 1
deanishe Posted November 30, 2019 Posted November 30, 2019 11 hours ago, vitor said: Doesn’t @deanishe’s Searchio! do the same (and more) as this Workflow? Mine shows search suggestions. This one scrapes the actual search results from the webpage. That's the reason it breaks quite often. vitor 1
Skone Posted February 24, 2020 Posted February 24, 2020 @aviaryan do you have any plans to update this workflow? Is it still possible to achieve inline search results or do you feel google changes this stuff too often?
deanishe Posted February 24, 2020 Posted February 24, 2020 On 7/4/2019 at 5:39 PM, bazerman said: 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? Scraping HTML ranges from pretty simple to really complex, depending on what you're trying to scrape. Scraping Google results isn't technically difficult. The problem is that they change the website frequently, which breaks the workflow. They also have a lot of defences in place to prevent scraping. 2 hours ago, bazerman said: do you feel google changes this stuff too often? I've had some luck scraping Google by sending a really old user agent. They did change the HTML last year, but it was stable for a long time before that. The page looked to be straight out of 2005.
Skone Posted February 25, 2020 Posted February 25, 2020 Thanks Deanishe, makes sense. I wonder if there's an alternative search engine that's more stable to build an in-line search workflow from. I'm honestly surprised this isn't at the top of everyone's lists, it seems like one of the most obvious and effective uses of alfred! JJJJ 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now