jin5354 Posted May 4, 2017 Share Posted May 4, 2017 (edited) I wrote a workflow in ruby to convert currency. Requires Alfred v3. Notice: The Old versions(v1.2-) api has been out of service at June 5, 2018. Please update to v1.3+ to keep using currency conversion feature. Github Download Features: Support 30+ currency units with fixer.io. Basic support for sign. e.g.,$,¥,£,etc. Customizable displayed currency units and base unit. Input once to get all result. Usage: Tap 'cy' to get latest exchange rates. Tap 'cy money' to get exchanged result. You can press enter to send the result to the clipboard. Tap 'add-cy', 'remove-cy' to customize displayed currency units. Tap 'base-cy' to set base currency unit. Hope you like it. Edited June 8, 2018 by jin5354 shadylane, arsenty, Mike Outram and 3 others 5 1 Link to comment
vitor Posted May 4, 2017 Share Posted May 4, 2017 (edited) This looks really clean, and the “Last Updated” is a welcome touch. Questions: How often are exchange rates updated? When are they updated, in the Workflow’s life? Meaning, are they auto-updated before or after we make queries, or at specific times (when?), or does it use another method? Where is the exchange rates info coming from? Requests: Add Bitcoin support. Let us type a number to get an immediate converted value. And a small note: There’s no point on zipping an Alfred Workflow. The .alfredworkflow format is itself a .zip with a renamed extension. Edited May 4, 2017 by vitor Link to comment
jin5354 Posted May 4, 2017 Author Share Posted May 4, 2017 6 minutes ago, vitor said: This looks really clean, and the “Last Updated” is a welcome touch. Questions: How often are exchange rates updated? When are they updated, in the Workflow’s life? Meaning, are they auto-updated before or after we make queries, or at specific times (when?), or does it use another method? Where is the exchange rates info coming from? The info comes from Fixer.io, a free api where you can get exchange rates published by the European Central Bank. Fixed.io updates it's data daily around 4PM CET(actually not accurately, maybe some delay or advance). Everytime we make queries it'll send request to fixer.io to get latest data. I'll modify this workflow's extension later, thank you for your hint. Link to comment
jenz Posted October 4, 2017 Share Posted October 4, 2017 (edited) Thanks for this. The currency converter I've used for the past few years died some months ago, with no sign of an update or fix. So I am glad to be able to switch over to this workflow you have kindly provided. Cheers... P.S. The download file still needs to be unzipped. In case you forgot to correct that. Edited October 4, 2017 by jenz Link to comment
liatmgat Posted November 7, 2017 Share Posted November 7, 2017 Thank you! Just what I was looking for. Any possibility of adding the "Let us type a number to get an immediate converted value" feature? Thank you! Liat Link to comment
bed Posted December 21, 2017 Share Posted December 21, 2017 Thanks from me too - excellent! Link to comment
kodiak Posted January 23, 2018 Share Posted January 23, 2018 Thank you for this wonderful workflow! I was wondering how can I customize it as follows: 1. Remove the "cy" prefix to trigger the workflow, instead having the currency code itself (which is always a suffix) as the trigger (i. e. 100 USD or 100 EUR). This is similar to Spotlight. 2. Making the workflow work whether you put a space between the numeric value and the currency code or not (i. e. 100USD = 100 USD). Thanks! Link to comment
RomanSimak Posted February 21, 2018 Share Posted February 21, 2018 It does not work for me I added it successfully to workflow but for the keyword cy it is not triggered when I rund alfred. Link to comment
deanishe Posted February 21, 2018 Share Posted February 21, 2018 Hi @RomanSimak, welcome to the forum. It's not really possible to diagnose an issue with so little information. Could you read the thread on reporting problems and follow its suggestions? In particular, you should be seeing a real error message in Alfred's debugger. Link to comment
Vero Posted February 21, 2018 Share Posted February 21, 2018 @RomanSimak Welcome to the forum. Could you please fill in your Powerpack email address in your forum profile before taking part in Workflows discussions? It's only visible to admins but allows us to confirm your Powerpack status Cheers, Vero Link to comment
Dr. Woo Posted April 19, 2018 Share Posted April 19, 2018 It would be nice if "cy EUR" (so without a number) would already display the exchange rates for in this case the EUR. Currently it is required to enter "cy 1 EUR" to get any results. Furthermore it would be cool to have the option that the listed "converted to"-Currency aren't shown alphabetically, but in order of usage, so the workflow should learn and adapt to the currency I convert to (& copy the conversion result) most often. This allows me to just hit "Enter" or "Arrow down + Enter" to copy my desired result, instead of closely looking at the results and using "CMD + Listnumber". Link to comment
ymolodtsov Posted June 7, 2018 Share Posted June 7, 2018 The converter completely stopped working for some reason. It's a shame, it was the best one in my opinion. It can barely recognize its own command. Link to comment
jin5354 Posted June 8, 2018 Author Share Posted June 8, 2018 6 hours ago, ymolodtsov said: The converter completely stopped working for some reason. It's a shame, it was the best one in my opinion. It can barely recognize its own command. I just updated this post. The old versions(v1.2-) api has been out of service at June 5, 2018. Please update to v1.3+ to keep using??. Link to comment
ymolodtsov Posted June 8, 2018 Share Posted June 8, 2018 5 hours ago, jin5354 said: I just updated this post. The old versions(v1.2-) api has been out of service at June 5, 2018. Please update to v1.3+ to keep using??. Great news, thank you so much! Link to comment
ymolodtsov Posted July 16, 2018 Share Posted July 16, 2018 (edited) I've just noticed strange behaviour: for some reason it doesn't really work for euro when I specifically type it. Works with any other currency I choose, but if it's 'cy 100 eur' there it just falls back to the usual Alfred search. Edited July 16, 2018 by ymolodtsov Link to comment
jin5354 Posted July 18, 2018 Author Share Posted July 18, 2018 On 7/17/2018 at 5:49 AM, ymolodtsov said: I've just noticed strange behaviour: for some reason it doesn't really work for euro when I specifically type it. Works with any other currency I choose, but if it's 'cy 100 eur' there it just falls back to the usual Alfred search. 3 Sorry, I tried but cannot reproduce this issue, 'cy 100 eur' works fine at version 1.4 on my laptop. 'Falls back to the usual Alfred search' may be caused by occasional failed API request, because of the unstable network, which should back to normal after a few seconds or just retap the command. If you can 100% reproduce this issue please report the steps to me, thank you. Link to comment
ymolodtsov Posted July 20, 2018 Share Posted July 20, 2018 (edited) Edited: I've just realized that there was an update on June 8 and it works there, thank you! Edited July 20, 2018 by ymolodtsov Link to comment
AJCrowley Posted July 27, 2018 Share Posted July 27, 2018 Not sure of the etiquette here, but I've modified this workflow to handle Bitcoin as well. It's my first time ever writing Ruby, or for Alfred, so please bear with me if I'm not following best practices, and Jin5354 - if you wish to incorporate any of this into your existing code base (or improve upon it), by all means please feel free. The only files that have been altered are BTC.png has been added to the flags directory, and convert.rb has been modified. However, rather than posting only those files and expecting people to take it apart and put it back together, I'll just post the modded workflow. It seems the board won't accept this file type as an attachment, so I just threw it on a file hosting service: https://nofile.io/f/2Orgj7NKZ7z/Currency.Convert.v1.4.btcmod.alfredworkflow I hope that someone finds this useful, and if for any reason this is against etiquette or the rules, by all means let me know and I'll take it down. Cheers! Link to comment
deanishe Posted July 27, 2018 Share Posted July 27, 2018 4 minutes ago, AJCrowley said: so please bear with me if I'm not following best practices The proper and polite thing to do (for a project that hasn't been abandoned) would be to fork the workflow on GitHub (here's the link from the OP) and then submit a pull request with your changes there. It's certainly helpful to users to provide an updated version of the exported workflow, but makes life unnecessarily difficult for the workflow developer if you'd like your changes incorporated upstream. Link to comment
AJCrowley Posted July 27, 2018 Share Posted July 27, 2018 (edited) 26 minutes ago, deanishe said: The proper and polite thing to do (for a project that hasn't been abandoned) would be to fork the workflow on GitHub (here's the link from the OP) and then submit a pull request with your changes there. Thanks, I did consider submitting a PR, but I don't know if the original dev would want this admittedly somewhat scrappy code in their lovely project. I wouldn't feel right submitting a PR without properly integrating it with the add/remove functionality, and for now, it's just hacked in there. If they do, they're free to use it. If I get around to developing a more elegant solution, I'll definitely fork/PR. Edited July 27, 2018 by AJCrowley Link to comment
AJCrowley Posted July 27, 2018 Share Posted July 27, 2018 (edited) Ok @deanishe, I've done it the right way. Added in support for BTC through add/remove as with other currencies, and can also set BTC as the base. I've forked the original author's repo and submitted a pull request. If there's anything else I should do to keep everything proper, I'd appreciate the advice! In the meantime, you can check it out here: https://github.com/AJCrowley/alfred3-workflow-CurrencyConvert Thanks! Edited July 27, 2018 by AJCrowley Link to comment
DD. Posted August 30, 2018 Share Posted August 30, 2018 Api url on Exchange Rate Api.io has changed to https://api.exchangeratesapi.io/latest So in code, u need to replace https://exchangeratesapi.io/api/latest with https://api.exchangeratesapi.io/latest (add.rb, base.rb, convert.rb and remove.rb) Maybe this could be replaced by some variable so in case of this change u don't need to replace it on 6 places Cheers, DD Link to comment
StevenP Posted September 16, 2018 Share Posted September 16, 2018 This does not work for me. I have downloaded both versions 1.5 and 1.3 with the same result. Alfred does not recognize the units. Double clicking the .alfredworkflow file does not properly install the workflow. Thanks for any suggestions to fix. Output from debugging mode is below: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Starting debug for 'Currency Convert' [2018-09-16 13:01:06][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:80:in `<main>' [2018-09-16 13:01:10][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:50:in `<main>' [2018-09-16 13:01:10][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:50:in `<main>' [2018-09-16 13:01:10][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:50:in `<main>' [2018-09-16 13:01:11][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:50:in `<main>' [2018-09-16 13:01:11][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:918:in `connect' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:477:in `get_response' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:454:in `get' from ./convert.rb:50:in `<main>' ------------------------------------------------------------------------------------------------------------ Link to comment
deanishe Posted September 16, 2018 Share Posted September 16, 2018 (edited) Hi @StevenP, welcome to the forum. 14 minutes ago, StevenP said: This does not work for me. I have downloaded both versions 1.5 and 1.3 with the same result By the looks of it, the problem isn't the workflow, it's your system: sslv3 alert handshake failure (OpenSSL::SSL::SSLError) Which version of macOS are you using? If it's older than High Sierra, it has a very, very old version of OpenSSL that does not support SSLv3. Edited September 16, 2018 by deanishe StevenP 1 Link to comment
StevenP Posted September 16, 2018 Share Posted September 16, 2018 53 minutes ago, deanishe said: Hi @StevenP, welcome to the forum. ... Which version of macOS are you using? If it's older than High Sierra, it has a very, very old version of OpenSSL that does not support SSLv3. Yes, I'm using Yosemite. OK, so I can resolve by updating the OS. Is it possible to install an older version of Currency converter to use with an OS like Yosemite? Thanks in any event, SP Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now