Daydreamer-riri / PowerToys-Run-WebSearchShortcut

This is a simple PowerToys Run plugin for quickly select a specific search engine to perform searches.
MIT License
122 stars 9 forks source link

Several keywords (query params) #15

Closed H7ioo closed 4 months ago

H7ioo commented 4 months ago

I found the need to have several search params like this URL for example: https://translate.google.com/?sl=en&tl=de&text=Hello%20world it would be nice to have such a feature.

My suggestion is to have %s1 %s2 %s3...%sn in the URL so it indicates that this URL accepts several parameters. The number indicates the sort when you actually call the command.

Examples:

{
  "Google Translate": {
    "Url": "https://translate.google.com/?sl=%s2&tl=%s3&text=%s1", // order is specified by the number written after the s
    "SuggestionProvider": "Google Translate",
    "Keyword": "!T"
  }
}

image

Another way is to not implement the sort thing because usually, the order in the URL doesn't matter.

{
  "Google Translate": {
    "Url": "https://translate.google.com/?text=%a&sl=%b&tl=%c", // order is specified by the order of the params
    "SuggestionProvider": "Google Translate",
    "Keyword": "!T"
  }
}

image

Daydreamer-riri commented 4 months ago

‌‌‌Thank you for your suggestion! The original purpose of WSS was to implement the functionality of being able to select different search engines for searching, like flow launcher, Alfred, or the Edge address bar. Currently, none of these applications have realized this feature (because the essence of search only requires search terms), so I also lack motivation to further implement this feature.

Back to your scenario, the other parameters you need are likely related to search configuration items. Perhaps you can achieve the same effect by creating more Items. For example:

{
  "Google Translate": {
    "Url": "https://translate.google.com/?text=%a&sl=en&tl=de",
    "Keyword": "!T"
  },
  "Google Translate to z": {
    "Url": "https://translate.google.com/?text=%a&sl=en&tl=zh",
    "Keyword": "!TZ"
  }
}
H7ioo commented 4 months ago

Appreciate the response.

Yes this way around will do the trick it didn't come to my mind.

Later on I'll see if I can implement it myself.

Thanks again 🙏

otravers commented 1 month ago

I hope it's not rude to post in a issue already closed as "not planned." Let me make the case for multi-parameter search. Some websites such as Allmusic have scoped search, which I used to handle in Launchy with its runner feature, like so: http://www.allmusic.com/search/%1/%2