Skip to content

Commit

Permalink
Updated to work with Alfred 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppestaerk committed Aug 29, 2019
1 parent 24276e1 commit 302f247
Show file tree
Hide file tree
Showing 6 changed files with 1,062 additions and 401 deletions.
Binary file modified alfred-currency-conversion.alfredworkflow
Binary file not shown.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const osLocale = require('os-locale');
const query = [];
const output = [];
const promises = [];
const api = 'https://api.fixer.io';
const api = 'https://api.exchangerate-api.com/v4';
const currencies = ["AUD", "BGN", "BRL", "CAD", "CHF", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HRK", "HUF", "IDR", "ILS", "INR", "ISK", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PLN", "RON", "RUB", "SEK", "SGD", "THB", "TRY", "USD", "ZAR"];
const topCurrencies = ["USD", "EUR", "JPY", "GBP", "CHF", "CAD", "AUD"];
const lastUpdate = new Date(alfy.cache.get('updateDate'));
Expand Down Expand Up @@ -34,7 +34,7 @@ function cacheRates(data) {
}

function updateRates(base) {
return alfy.fetch(`${api}/latest?base=${base}`).then(cacheRates);
return alfy.fetch(`${api}/latest/${base}`).then(cacheRates);
}

function addBaseOutput() {
Expand Down
12 changes: 8 additions & 4 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -136,7 +138,7 @@
<key>uid</key>
<string>BC036EA6-E275-4C9E-B3A3-3E89948DF194</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -146,7 +148,7 @@
<key>escaping</key>
<integer>0</integer>
<key>script</key>
<string>tell application "Alfred 3" to search "curcon {query}"</string>
<string>tell application "Alfred 4" to search "curcon {query}"</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -195,7 +197,7 @@
<key>uid</key>
<string>52C50F4F-C06D-498E-B2F7-AFF0A7072F26</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand Down Expand Up @@ -326,8 +328,10 @@ MIT © [Jeppe Stærk](https://staerk.io)</string>
<integer>210</integer>
</dict>
</dict>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string></string>
<string>v0.2.0</string>
<key>webaddress</key>
<string>https://github.com/jeppestaerk/alfred-currency-conversion#readme</string>
</dict>
Expand Down
Loading

0 comments on commit 302f247

Please sign in to comment.