4 ms·
Here it is in nushell: /tmp> # be kind to the server and only download the file if it's updated /tmp> curl -s -o /tmp/euro.zip -z /tmp/euro.zip https:/
by llimllib 3y ago
Here it is in nushell:
/tmp> # be kind to the server and only download the file if it's updated
/tmp> curl -s -o /tmp/euro.zip -z /tmp/euro.zip https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip
/tmp> unzip -p /tmp/euro.zip | from csv | select Date USD | sort-by USD | first
╭──────┬────────────╮
│ Date │ 2000-10-26 │
│ USD │ 0.83 │
╰──────┴────────────╯
(I removed the pipe to gunzip because 1. gunzip doesn't work like that on mac and 2. it's not something you should expect to work anyway, zip files often won't work like that, they're a container and their unzip can't normally be streamed)
- shortrounddev2 3y ago> be kind to the server and only download the file if it's updated I wonder if their webserver supports the If-modified-since http header
- sltkr 3y agoYou can check with `curl -v`. tl;dr: the server doesn't support that header, but since the response does include a Last-Modified header, curl helpfully aborts the transfer if the Last-Modified date is the same as the mtime of the previously downloaded file.
- jwilk 3y agoThis is not a secure use of /tmp.