deanishe Posted August 2, 2014 Share Posted August 2, 2014 (edited) Searchio! workflow for Alfred Auto-suggest search results from multiple search engines and languages. There are a few existing workflows that provide auto-suggest results from one or the other search engine, but this includes not only multiple search engines, but also allows you to specify multiple languages/regions for your results. Supports the following search engines/websites: Google Google Images Google Maps YouTube Wikipedia Wiktionary Amazon eBay DuckDuckGo Bing Yahoo! Ask.com Yandex.ru Naver.com Wikia.com Download and installation Download the latest version from the GitHub releases page or Packal. Usage There are several searches pre-configured. Only some have keywords (i.e. can be used as-is): g — Search Google in system (i.e. default) language m — Search Google Maps in system (i.e. default) language gi — Search Google Images in system (i.e. default) language w — Search Wikipedia in system (i.e. default) language wn — Search Wiktionary in system (i.e. default) language a — Search Amazon in system (i.e. default) language. If your system language is English, this will search Amazon.com. Use -l uk in the Script Filter to search Amazon.co.uk or -l ca to search Amazon.ca. yt — Search YouTube in system (i.e. default) language searchio [<query>] — Show settings and list of supported search engines. Currently, the only setting is a toggle to also show the <query> in the results list (default: No). searchiohelp — Open help file in your browser You can add a keyword to (and edit) one of the existing examples or add your own searches. For details on how to do that, see the GitHub page. Licensing, thanks The code in this workflow is released under the MIT Licence. The icons belong to the respective search engines. This workflow uses the Alfred-Workflow library and docopt (both MIT-licensed). Edited August 20, 2017 by deanishe Update list of supported search engines FroZen_X, thec13, xilopaint and 5 others 8 Link to comment
Don Dahl Posted August 3, 2014 Share Posted August 3, 2014 (edited) Awesome workflow. I like the versatility! This is truly amazing. I can see the potential for this workflow to evolve and include other searches such as IMDb and the like, so we don't need separate workflows for the same tasks. Cyber-highfive! One thing that'd be a nice addition would be the option to hold a modifier key to do a regular search without the suggesting feature. Edit: When using the google part of your workflow it's taking me to the actual search field and i need to hit the enter key in order to do the actual search. Is this intended? Edited August 3, 2014 by Arthur deanishe 1 Link to comment
deanishe Posted August 3, 2014 Author Share Posted August 3, 2014 Hmm. No, it shouldn't be doing that with Google. I did try with including the search query as-is as the top result, but ultimately decided against it. If that's what folks want, I'll put it back in. If you don't mind hacking the source a wee bit, if you comment out line 112 in search.py and uncomment lines 114 and 115, that will make the entered query the first result. Using a modifier to turn off suggestions won't work, as that isn't how Alfred uses modifiers. In that case, I'd suggest assigning, for example, the keyword s to a standard Alfred Web Search and si to a Searchio! auto-suggestion search. It should be easy enough to add other search engines, depending on their suggestions API. Link to comment
Don Dahl Posted August 3, 2014 Share Posted August 3, 2014 Can i do something to help to figure out why it's taking me to the actual search field of google? I'm not savvy enough to edit that kinda stuff mate. I hope other people would want the behavior i do since then there's no need for no custom google search. I love All-in-Ones Link to comment
deanishe Posted August 3, 2014 Author Share Posted August 3, 2014 What browser are you using? When you action a search result in the workflow, what URL does your browser show? Link to comment
Don Dahl Posted August 3, 2014 Share Posted August 3, 2014 I'm using safari. It shows https://www.google.com/webhp?q=let's+see&gws_rd=ssl Link to comment
deanishe Posted August 3, 2014 Author Share Posted August 3, 2014 I've uploaded a new version with a different URL for Google and an optional setting to toggle showing the query in the search results (use searchio to view the setting and action the "Show query in results" item to toggle the setting). Could you give that one a try and see if Google now works properly for you? Link to comment
Don Dahl Posted August 3, 2014 Share Posted August 3, 2014 That's awesome deanishe. Everything works like a charm now. Good one, thanks a bunch! Link to comment
Southgirl Posted August 4, 2014 Share Posted August 4, 2014 Hi deanishe, is this compatible with Snow Leopard? Link to comment
deanishe Posted August 4, 2014 Author Share Posted August 4, 2014 Hi deanishe, is this compatible with Snow Leopard? Not sure, to be honest (I don't have SL to test it on). It should be, however. I don't believe it uses any Python features that weren't around in 2.6. Give it a try, and if there are any errors, we might be able to fix them. Link to comment
deanishe Posted August 7, 2014 Author Share Posted August 7, 2014 Update: Added 5 new search engines: Amazon eBay Google Images Google Maps YouTube Don Dahl 1 Link to comment
Don Dahl Posted August 8, 2014 Share Posted August 8, 2014 Seriously man. This workflow should be a native instead of the regular custom searches currently available. I really enjoy it! deanishe 1 Link to comment
deanishe Posted August 27, 2014 Author Share Posted August 27, 2014 Updated to version 1.4 to fix an incorrect URL for Google Maps search. Thanks to Vítor for finding and fixing the bug. Link to comment
40-02 Posted August 28, 2014 Share Posted August 28, 2014 (edited) Great workflow! Is it possible to add support of yandex.ru? Edited August 28, 2014 by 40-02 Link to comment
deanishe Posted August 28, 2014 Author Share Posted August 28, 2014 Yes, it is. I'll try to get that added over the weekend. Really busy with work at the moment 40-02 1 Link to comment
smarg19 Posted August 28, 2014 Share Posted August 28, 2014 Feature suggestion: have 'searchio' keyword search all engines and lost top result from each. Also, allow user configuration for the order of the engines (e.g. Wikipedia, then DuckDuckGo, then google, etc) Link to comment
deanishe Posted August 28, 2014 Author Share Posted August 28, 2014 I tried that. It doesn't work. The first problem is that you don't get any results till all the web queries finish, so the speed of the workflow is restricted to that of your slowest search engine, and some are a lot faster than others. Secondly, you end up with lots of duplicate results. Either you strip out the duplicates, so you only have results from one search engine, which largely defeats the purpose of combining multiple search engines' results, or you have 10 results that are all the same, just from different places, which isn't very helpful. Thirdly, one of my main motivations was to enable users to search in different languages easily. And by that I mean multiple languages per user. As some search engines are set up by region and others by language, it's not really feasible to combine the results in a meaningful way (pass "uk" to Google or Wikipedia and you get Ukrainian results, pass "uk" to Amazon or Yahoo! and you get results from their British sites). Link to comment
deanishe Posted August 29, 2014 Author Share Posted August 29, 2014 (edited) Yeah. When I started the workflow, that was basically the objective. I wanted to create a super-cool search-all-the-engines! auto-suggest workflow, but it quickly became apparent that it wasn't a particularly viable idea Still, I think it's turned out okay. The next step is, hopefully, to make it configurable without having to mess around with the workflow itself, much like Fuzzy Folders works. It annoys the hell out of me having to reconfigure the bleeder to my own purposes after every new release The major hurdle is being able to figure out exactly what languages/regions are available for each search engine. I suppose I could add what I'm aware of by default but still allow users to specify different languages/regions. Edited August 29, 2014 by deanishe Link to comment
jarnot Posted January 13, 2015 Share Posted January 13, 2015 I get the following error when trying to do a Wikipedia search. Any ideas? [ERROR: alfred.workflow.input.scriptfilter] Code 1: 10:14:06 search.py:438 DEBUG subclass : Google 10:14:06 search.py:438 DEBUG subclass : Google Images 10:14:06 search.py:438 DEBUG subclass : Google Maps 10:14:06 search.py:438 DEBUG subclass : YouTube 10:14:06 search.py:438 DEBUG subclass : Amazon 10:14:06 search.py:438 DEBUG subclass : eBay 10:14:06 search.py:438 DEBUG subclass : Bing 10:14:06 search.py:438 DEBUG subclass : Yahoo! 10:14:06 search.py:438 DEBUG subclass : DuckDuckGo 10:14:06 search.py:438 DEBUG subclass : Wiktionary 10:14:06 search.py:438 DEBUG subclass : Wikipedia 10:14:06 search.py:438 DEBUG subclass : Ask 10:14:06 search.py:111 DEBUG key components : [u'Wikipedia', u'lang', u'en', u'query', u'b', u'engine', u'wikipedia'] 10:14:06 workflow.py:1210 ERROR too many values to unpack Traceback (most recent call last): File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 1208, in run func(self) File "search.py", line 524, in main results = engine.search() File "search.py", line 116, in search results = self.wf.cached_data(key, self._suggest, max_age=600) File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 936, in cached_data data = data_func() File "search.py", line 402, in _suggest _, results = response.json() ValueError: too many values to unpack [ERROR: alfred.workflow.input.scriptfilter] Code 1: 10:14:07 search.py:438 DEBUG subclass : Google 10:14:07 search.py:438 DEBUG subclass : Google Images 10:14:07 search.py:438 DEBUG subclass : Google Maps 10:14:07 search.py:438 DEBUG subclass : YouTube 10:14:07 search.py:438 DEBUG subclass : Amazon 10:14:07 search.py:438 DEBUG subclass : eBay 10:14:07 search.py:438 DEBUG subclass : Bing 10:14:07 search.py:438 DEBUG subclass : Yahoo! 10:14:07 search.py:438 DEBUG subclass : DuckDuckGo 10:14:07 search.py:438 DEBUG subclass : Wiktionary 10:14:07 search.py:438 DEBUG subclass : Wikipedia 10:14:07 search.py:438 DEBUG subclass : Ask 10:14:07 search.py:111 DEBUG key components : [u'Wikipedia', u'lang', u'en', u'query', u'bos', u'engine', u'wikipedia'] 10:14:07 workflow.py:1210 ERROR too many values to unpack Traceback (most recent call last): File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 1208, in run func(self) File "search.py", line 524, in main results = engine.search() File "search.py", line 116, in search results = self.wf.cached_data(key, self._suggest, max_age=600) File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 936, in cached_data data = data_func() File "search.py", line 402, in _suggest _, results = response.json() ValueError: too many values to unpack [ERROR: alfred.workflow.input.scriptfilter] Code 1: 10:14:07 search.py:438 DEBUG subclass : Google 10:14:07 search.py:438 DEBUG subclass : Google Images 10:14:07 search.py:438 DEBUG subclass : Google Maps 10:14:07 search.py:438 DEBUG subclass : YouTube 10:14:07 search.py:438 DEBUG subclass : Amazon 10:14:07 search.py:438 DEBUG subclass : eBay 10:14:07 search.py:438 DEBUG subclass : Bing 10:14:07 search.py:438 DEBUG subclass : Yahoo! 10:14:07 search.py:438 DEBUG subclass : DuckDuckGo 10:14:07 search.py:438 DEBUG subclass : Wiktionary 10:14:07 search.py:438 DEBUG subclass : Wikipedia 10:14:07 search.py:438 DEBUG subclass : Ask 10:14:07 search.py:111 DEBUG key components : [u'Wikipedia', u'lang', u'en', u'query', u'boston', u'engine', u'wikipedia'] 10:14:07 workflow.py:1210 ERROR too many values to unpack Traceback (most recent call last): File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 1208, in run func(self) File "search.py", line 524, in main results = engine.search() File "search.py", line 116, in search results = self.wf.cached_data(key, self._suggest, max_age=600) File "/Users/kevinjarnot/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.8A46AE4B-BA25-473D-923A-63FB0A7604B3/workflow/workflow.py", line 936, in cached_data data = data_func() File "search.py", line 402, in _suggest _, results = response.json() ValueError: too many values to unpack Link to comment
deanishe Posted January 13, 2015 Author Share Posted January 13, 2015 The Wikipedia API has changed. I've fixed this in v1.5. Grab it from GitHub or Packal. Link to comment
jarnot Posted January 14, 2015 Share Posted January 14, 2015 That fixed it. Thanks! deanishe 1 Link to comment
deanishe Posted January 19, 2015 Author Share Posted January 19, 2015 (edited) Quote My system language is brazilian portuguese. When I try to search on amazon the workflow lead me to a non-existent domain (amazon.pt), however the correct brazilian domain is amazon.com.br. Could it be easily fixed? Unfortunately, the Amazon sites all need to be hand-coded to get the right suggestions language, domain etc. I've added amazon.com.br in version 1.6. Also added yandex.ru (Russian-language only). Download from GitHub. Edited June 24, 2019 by deanishe Replace real name xilopaint 1 Link to comment
xilopaint Posted January 19, 2015 Share Posted January 19, 2015 Unfortunately, the Amazon sites all need to be hand-coded to get the right suggestions language, domain etc. I've added amazon.com.br in version 1.6. Also added yandex.ru (Russian-language only). Download from GitHub. Thank you! Would be nice to have a foursquare search with suggestions. Link to comment
Subject22 Posted January 27, 2015 Share Posted January 27, 2015 Is there any way to make one of these searches the fallback search option in Alfred? Love the workflow, by the way Link to comment
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