Jump to content
tomulent

Custom Searches With Full Url as the Query

Recommended Posts

I'm trying to make a custom web search for the Wayback Machine. The query looks like this

https://web.archive.org/web/*/{query}

where {query} is a full URL from the clipboard. The problem is that Alfred changes the special characters into %2F and such so that the resulting search URL looks like:

https://web.archive.org/web/*/http%3A%2F%2Fexamplecom%2F

Is this solvable, or will I need a workflow of some sort?

Share this post


Link to post

Hmm, interesting.  I'm not sure how Alfred handles the URL for searches, but in my testing it looks like you will have to convert the characters first in a workflow, or at least remove the first "http://" with parsing ... because "example.com" works ok.

 

This MAY be a feature request for Alfred ... to internally parse out those characters

Edited by RodgerWW

Share this post


Link to post

Instead of using the Open URL action, use a Run Script action (language = bash) with:

 

open "https://web.archive.org/web/*/{query}"
It Just Works™.

Alfred is between a rock and hard place here, as some (most?) websites expect {query} to be properly URL-encode, while others choke on such URLs.

The fundamental issue is, unless {query} is the entire URL, Alfred treats {query} as the value to a GET parameter (e.g. http://www.example.com/?argument={query}). If {query} is actually part of the URL path (e.g. http://www.example.com/{query}/new), this will break on most browsers. Some are smart enough to realise when a URL-encoded string is part of the URL path, not the query string, but most aren't.

Alfred should probably have a checkbox to turn URL-encoding on/off.

Edited by deanishe

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