Jump to content

How do I create a custom search for a site with autocomplete?


Recommended Posts

I'm trying to create a custom search for a site which uses autocomplete (like google), but when you click one of the suggestions it doesn't have a search query link it goes straight to the page itself. 

 

Any ideas?

 

The autocomplete would have to be provided via an API that you had access to in order to pull this off. So, good example is, the Google Search workflow that is included with Alfred. You can send a request to a single URL and it returns autocomplete results. You parse those and then provide feedback to Alfred.

Link to comment

I'm trying to create a custom search for a site which uses autocomplete (like google), but when you click one of the suggestions it doesn't have a search query link it goes straight to the page itself. 

 

Any ideas?

 

 

Which site are you trying to make it for?

 

Search engine APIs typically only provide search suggestions, not URLs to the actual matching pages. With some sites, e.g. Wikipedia, it's pretty simple to figure out the page URL from the API's suggestions.

 

If the site doesn't have an API, you'll have to figure out how the site search works and parse the HTML. My Duden workflow works this way (there's no API). This is considerably more difficult than using an API and liable to break at any time.

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