|
@@ -1,27 +0,0 @@
|
1
|
|
-#!/bin/bash
|
2
|
|
-
|
3
|
|
-. $(ffoom path)
|
4
|
|
-
|
5
|
|
-ffoo import pretty
|
6
|
|
-
|
7
|
|
-uri='https://www.cnb.cz/en/financial_markets/foreign_exchange_market/exchange_rate_fixing/daily.txt'
|
8
|
|
-
|
9
|
|
-get_field() {
|
10
|
|
- local wntcur=$1
|
11
|
|
- local wntfld=${2:-Rate}
|
12
|
|
- local fldn
|
13
|
|
- case "$wntfld" in
|
14
|
|
- Country|Currency|Amount|Code|Rate) true;;
|
15
|
|
- *) usage_is "code Country|Currency|Amount|Code|Rate" ;;
|
16
|
|
- esac
|
17
|
|
- local date head
|
18
|
|
- read date
|
19
|
|
- read head
|
20
|
|
- IFS='|'; while read Country Currency Amount Code Rate;
|
21
|
|
- do
|
22
|
|
- test "$wntcur" = "$Code" && echo ${!wntfld}
|
23
|
|
- done
|
24
|
|
-}
|
25
|
|
-
|
26
|
|
-curl --insecure --silent "$uri" \
|
27
|
|
- | get_field ${1:-USD} Rate
|