Jump to content

Web Searches - Search on any website from Alfred

Recommended Posts

Web Searches



This workflow lets you open any web submission on the Internet. Such as quickly making a Reddit post to some subreddit, creating a new GitHub repo. Making a post on stack exchange forum and more.


This workflow is an alternative to Alfred builtin web searches. I made it because I wanted to fuzzy search for the website I want to search on and I wanted something that the community can extend.


This workflow achieves both these goals. You can extend the list of websites being searched for here and you can quickly select the website from a big list by simply typing where you want to search on.


This workflow searches a big list of websites that can be found here similar to DuckDuckGo Bang operators. If you wish to extend it, you can do it.


For more information, on how you can use the workflow, you can read the GitHub readme.


Hope you like it. ?



Edited by nikivi
Link to comment

Thank you @deanishe


This version now has fuzzy searching + it has a logo I made for it (not the best logo in the world), I will change it later. :) 


There is ~ 250 searches now there and I hope the list grows in the future to include any kind of website one can want to search for. 


Here you can find the latest download. I also should add auto update functionality, will try to add that. AwGo is a really awesome library. ?

Edited by nikivi
Link to comment

Updated the workflow to now include icons for each of the prefixes. Plus a rather neat default icon. 


You can grab the latest update from GitHub.


There is few issues though I have to solve. First, the fuzzy searching is acting really weirdly in regards to 'r: machine learning' option. For example why is machine learning the top pick when I type 'la' : 




Not really sure why that happens but 'r: machine learning' seems to dwarf most of the queries I do for some reason.


And also I could not figure out how to add auto updating mechanism. I looked at all the repos using AwGo and they use it together with a big options struct. I tried to emulate that but I am certain that does not work. I looked into Updater and how it was implemented but still find it a bit confusing + I don't really know how to test if it works, I guess by faking a release and looking at a debugger but not sure.


Also I am struggling with extending this workflow with modifiers. For example I managed to get control modifier to work on results with 'r: ' prefix to scope the search to 'this week'. But I can't find a solution to have it scale without adding a ton of objects in Alfred. Ideally I would love to do this all through code if possible but I find working with Variables super messy. Will try to look into Alfred SSH and other repos though, perhaps I will find a way.


On the bright side, this workflow is looking pretty neat, I actually swapped all my static searches and will be now using this going forward. Since it's super easy to extend it too, would be lovely if community helps extend it.


Also I am not quite sure how to speed this up. I guess I can try to save the JSON AwGo builds with its Feedback mechanism and then have Alfred read that instead.

Edited by nikivi
Link to comment
9 hours ago, nikivi said:

I looked at all the repos using AwGo and they use it together with a big options struct.


I told you I refactored the API. The options structs are gone. Looking at workflows built with older versions of the library won't help. There's a full example included with the library. I can hardly make it any easier than that.


9 hours ago, nikivi said:

Also I am not quite sure how to speed this up.




Link to comment

Yeah you are right that it is quite fast now. But since I plan to include every *useful* website on Earth to be searchable through it, I think it will make sense later to not have the workflow read and parse the CSV every time it is ran. 


I will also try rewriting Searchio in Go as that is my most used workflow and any speed gain there would be super useful plus I would love to add more options like Quora searching as well as modifier supports for scoping searching to 'by week' 'by month' and so on.

Edited by nikivi
Link to comment
36 minutes ago, xilopaint said:

How the workflow works? I don't get to do a search.


Yeah as @deanishe said, you have to assign a hotkey to use the workflow.


The reason I don't include keyword (or title) is because I always strip that information from all the workflows I use to have more clean Alfred prompts and since I always know what the workflow does anyway I find that information unnecessary for me.


However I will probably have to add that information to the keyword (title) I guess since other users can be confused by it too. It's just I run all my workflows from hotkeys and never use the alfred global search prompt and I really dislike how the Title text flashes for a brief moment when I activate workflow from a hotkey. 


So yeah, either I have to before each release of the workflow, add manually the keyword and title, release the workflow and then strip them for my own personal use or not add them at all. Ideally I wish everyone just used hotkeys for everything but not many people are into keyboard customisation and rebinding as me. :( 

Edited by nikivi
Link to comment
  • 2 weeks later...

Added a small but very useful change to the workflow.

There is a new hotkey trigger that will take the selected text and then let you search that text on any of the websites available. I use that a lot now.

Can grab the latest release from GitHub.

I couldn't figure out how to add GitHub auto updating as the example deanishe provides is using docopt for argument parsing and I use kingpin and when I tried to use docopt, it was really confusing. I wish I could just use vitor's OneUpdater but I don't think I can in this kind of workflow.

I also want for the workflow to grab the latest CSV from GitHub and periodically download it locally to user's machine, will try to add that too soon.

Edited by nikivi
Link to comment

In fact this became my favourite workflow now. ? 


After my mind's workflow, github jump, safari assist and searchio. I cannot wait once every website on Earth will be added to the list. It would be insane.


I also love how you can really fine tune your search, something you couldn't do with Alfred's builtin web search. I can just do this : 




And instantly make the search. Fuzzy ?


Just need to figure out this auto updating thing and the grabbing of CSV from GitHub and I am done. I also love how the list is so easy to extend. I very often add websites I find quickly with my edit files workflow and I set up a hazel command to auto commit any website I add so all users using the workflow will get all the changes nearly instantly as well as any changes other users doing pull requests make.


I am also trying to rewrite Searchio as currently the python version is too slow and as Anycomplete shows it can be a lot faster. It would be lovely if @deanishe rewrote it himself in Go as I am certain he can do a lot better job at this than I will ever do because as it turns out I can't even add simple auto update. ?


Edited by nikivi
Link to comment
1 hour ago, nikivi said:

as Anycomplete shows it can be a lot faster


That's an unfair comparison of two incomparable things. Anycomplete is a plugin loaded once when the application starts. After that, it's permanently in memory and ready to run. Alfred starts an entirely new process each time it executes a workflow. Searchio! would be just as fast if it were run in the same way.


Rewriting in Go would certainly make it a lot faster, but Anycomplete will always be faster for the above reason.


It's also very easy to add your own engines to Searchio! because it's based on a single, importable base class, and uses reflection to discover engines. That is impossible in Go.

Edited by deanishe
Link to comment

Thank you @deanishe for the insight.

Perhaps there is another way you can add extensibility without using base classes and reflection but if you can't I guess Searchio will still be there.

All I really need is to cover my most used searches that I use too often (DuckDuckGo, YouTube, Google) because a speed improvement there would be completely amazing. As well as adding modifier options because Searchio did not want to include them too. Although the modifier searches can be easily achieved with modifying URL with regex I believe. Oh and adding Quora too, I remember you mentioning that was possible. 

I will try to get an MVP working soon and base as much of it on Searchio, hopefully it will be faster. Thank you though for making Searchio, it saved me days of time easily.

Edited by nikivi
Link to comment
48 minutes ago, nikivi said:

Perhaps there is another way you can add extensibility without using base classes and reflection but if you can't I guess Searchio will still be there


Using JSON/config files, not code. That's the direction I'm trying to take version 2, and if I can get the config format right, I will most likely rewrite at least the critical parts in Go/ObjC.


51 minutes ago, nikivi said:


I didn't want to include them in the "official" workflow. 


It's trivial to add yourself. The workflow expects you to add your own elements. That's how it works. And its design as described above makes it easy to extend.

Link to comment
Just now, xilopaint said:

release the stable version of Searchio 2.0 in the near future?


I haven't looked at it in a few months, tbh.


I'm still mulling over the config file format and core architecture. I've rewritten it ~5 times already, and every time I change it, I break my own most-used workflow :( 


The problem is, to get it right I need to add more engines, but the more engines I add, the more work it is to change…


The end goal is to allow you to add a search for the currently-open webpage directly from Alfred if it supports OpenSearch.


That would solve a big sticking point of what to do about Wikia, with its tens of thousands of sites, but is quite a job in itself.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

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