Skip to content

Commit

Permalink
Merge pull request #74 from whythefyouflying/main
Browse files Browse the repository at this point in the history
Add HTTPS to NBP API links
  • Loading branch information
jczaja authored Aug 23, 2023
2 parents b5e846d + 59cf686 commit ad18a10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/e-trade_tax_dividends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
function GetRate() {

prev_day=`date -d "$1 1 day ago" +'%F'`
kurs=`curl -X GET "http://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"`
kurs=`curl -X GET "https://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"`

while [ "$kurs" = "404 NotFound - Not Found - Brak danych" ]; do
prev_day=`date -d "$prev_day 1 day ago" +'%F'`
kurs=`curl -X GET "http://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"`
kurs=`curl -X GET "https://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"`
done

# Extract value from Json output
Expand Down
2 changes: 1 addition & 1 deletion src/pl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl etradeTaxReturnHelper::Residency for PL {
.build()
.expect_and_log("Could not create REST API client");

let base_exchange_rate_url = "http://api.nbp.pl/api/exchangerates/rates/a/";
let base_exchange_rate_url = "https://api.nbp.pl/api/exchangerates/rates/a/";

dates.iter_mut().for_each(|(date, val)| {
let mut converted_date = chrono::NaiveDate::parse_from_str(&date, "%m/%d/%y").unwrap();
Expand Down

0 comments on commit ad18a10

Please sign in to comment.