-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistent currency conversion bangs? #153
Comments
I did some napkin math, and that'd increase the number of bangs by a LOT. We're talking 26k (1.85x current bang count). I'll get a PR in later this afternoon, just to see if Margret feels like merging it. |
I think it'd be worth it to add currency conversions for the top 10(?) or so currencies if they don't already exist (not removing any that currently exist). That'd bring the total currency conversion bangs to 100, which is a lot more reasonable. Otherwise it gets into tricky territory where I want to shy away from creating a lot of bangs that no one will ever use, and will increase the size of the bangs json file substantially. I have been thinking about changing the bangs json format to allow for things like multiple triggers for the same bang and doing region autocomplete - maybe there could be something similar to that for this. |
Top n currencies is what I had in mind at first, but how do you define what a "top" currency is? Amount traded? Population of countries that use the currencies? |
Another thing we have been thinking about is allowing you to supply a regex with capture groups that is used when the bang's trigger is matched. This would allow you to effectively do "argument parsing" on the bang and sort the capture groups into different parameters, etc. |
Is your feature request related to a problem? Please describe.
There are currently 20 bangs redirecting to xe.com for currency conversion.1 For example:
As far as I can tell, all 20 bangs follow the pattern:
!<curA>2<curB>
👉https://www.xe.com/currencyconverter/convert/?Amount={{{s}}}&From=<curA>&To=<curB>
, withcurA
andcurB
being ISO 4217 3-letter currency codes.However, as a bangs user, there is no way to know which currency bang will exist, and which will not. For example,
!aud2eur 10
successfully redirects to xe.com to convert 10 AUD to EUR, but the opposite conversion!eur2aud 10
does not (the bang doesn't exist).Is it somehow possible to make all currency conversion bangs work as expected?
Describe the solution you'd like
Cover all currency conversions. It's probably not feasible to hardcode all possible
!<curA>2<curB>
bangs tobangs.json
, so we'd either need to add logic in the repo and generate them (creates more complexity), or to find a creative way to get a single bang to cover all conversions.Note that this is more of an open question than an actual feature request, and also to give visibility to the problem (that currency conversion bangs aren't consistent right now).
Additional context
n/a
Footnotes
one bang,
!xe
, redirects tohttps://xe.com/currency/{{{s}}}
, which 404s. ↩The text was updated successfully, but these errors were encountered: