forked from deanishe/alfred-convert
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace defunct Yahoo! Finance API with openexchangerates.org
- Loading branch information
Showing
22 changed files
with
2,468 additions
and
1,927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/build | ||
.cache | ||
|
||
# Python snippets from gitignore on github | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# Reject if APP_KEY is set | ||
|
||
# _error <arg>.. | Write red "error" and args to STDERR | ||
_error() { | ||
echo $(print -P '%F{red}error%f') "$@" >&2 | ||
} | ||
|
||
# _fail <arg>.. | Write red "error" and args to STDERR, then exit with status 1 | ||
_fail() { | ||
_error "$@" | ||
exit 1 | ||
} | ||
|
||
# _staged <path> | Is path staged | ||
_staged() { | ||
local p="$1" | ||
git diff --name-only --cached | grep --silent "$p" | ||
return $? | ||
} | ||
|
||
exec 1>&2 # Redirect output to stderr. | ||
|
||
_staged info.plist || exit 0 | ||
|
||
root="$( git rev-parse --show-toplevel )" | ||
ip="${root}/src/info.plist" | ||
|
||
# _getvar <name> | Retrieve value for variable <name> | ||
_getvar() { | ||
local n=$1 | ||
/usr/libexec/PlistBuddy -c "Print :variables:$n" "$ip" | ||
} | ||
|
||
# Fail if info.plist can't be found | ||
test -f "$ip" || { _fail "$ip not found"; } | ||
|
||
api_key="$( _getvar APP_KEY )" | ||
|
||
test -n "$api_key" && _fail "[info.plist] APP_KEY is not empty" | ||
|
||
exit 0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
|
||
# Currencies # | ||
Currencies | ||
========== | ||
|
||
`currencies_yahoo.py` throws a whole bunch of currencies at Yahoo! Finance, and saves a list of the ones it appears to know about. | ||
Lists of currencies and scripts to generate them. | ||
|
||
| File | Description | | ||
|---------------------------|-------------------------------------| | ||
| `currencies_iso_4217.tsv` | All ISO 4217 currency codes | | ||
| `currencies_custom.tsv` | Special currencies, e.g. Bitcoin | | ||
| `currencies_yahoo.tsv` | Exchange rates offered by Yahoo! | | ||
| `currencies_yahoo.py` | Script to generate above list | | ||
| `ISO 4217 List One.xlsx` | Source list from the [ISO][iso4217] | | ||
| File | Description | | ||
|-------------------------------|-----------------------------------------------------------| | ||
| `currencies_crypto.tsv` | Cryptocurrencies supported by [cryptocompare.com][crypto] | | ||
| `currencies_crypto.py` | Script to generate above list | | ||
| `currencies_iso_4217.tsv` | Most ISO 4217 currency codes | | ||
| `currencies_custom.tsv` | Unofficial currencies | | ||
| `currencies_openexchange.tsv` | Exchange rates offered by [openexchangerates.org][openx] | | ||
| `currencies_openexchange.py` | Script to generate above list | | ||
| `ISO 4217 List One.xlsx` | Source list from the [ISO][iso4217] | | ||
|
||
The first two TSV files are the input list of currencies. `currencies_yahoo.tsv` is the list of currencies that Yahoo! Finance has exchange rates for. | ||
|
||
This file is the `currencies.tsv` file distributed with the workflow. | ||
|
||
[iso4217]: http://www.iso.org/iso/home/standards/currency_codes.htm | ||
[iso4217]: https://www.iso.org/iso-4217-currency-codes.html | ||
[openx]: https://openexchangerates.org/ | ||
[crypto]: https://www.cryptocompare.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.