Bug 480062 - fx-rate fails to fetch currency exchange rates
Summary: fx-rate fails to fetch currency exchange rates
Status: CONFIRMED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-19 20:12 UTC by Pete
Modified: 2024-03-18 15:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pete 2024-01-19 20:12:44 UTC
STEPS TO REPRODUCE
1. Tools
2. Update Stock and Currency Prices ...

OBSERVED RESULT
Fetching URL https://fx-rate.net/USD/CAD...
Identifier found: ''
Price found: '1.3379' (1.3379)
Unable to update price for USD > CAD (no price or no date)

EXPECTED RESULT
A proper currency quote.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Ubuntu Linux 22.04 LTS
Comment 1 Jack 2024-01-19 20:15:43 UTC
It has nothing to do with the specific currencies, I get failures on other pairs.  It appears they changed the presentation, and I am struggling to update the date regexp to capture correctly.
Comment 2 Jack 2024-01-19 20:21:55 UTC
The problem seems to be that the date is now given as 
        var userDate = 'Fri, 19 Jan 2024 20:10:02 +0000';
and I am not sure if the parsing used will accept the named month instead of numbered.  Still working on it.
Comment 3 Jack 2024-01-19 21:49:18 UTC
Try this for the date regexp
var userDate = \'..., (\d* ... \d*)
let me know if it works for you.
Comment 4 Pete 2024-01-19 21:57:53 UTC
It works fine.
Comment 5 Jack 2024-01-19 22:04:08 UTC
Great.  I'll close this once we get it updated in the code base so new installs are OK.
Comment 6 Cos 2024-03-18 07:46:48 UTC
FWIW, I'm using the following regexes to extract the data from fx-rate.net: 

Price:  1\s[^=]+\s*=\s*<\/span>\s*<br>\s*<span>([^\s]+)
Date: <span class="datetime"[^>]+>\s*\d+:\d+:\d+\(\w+\)\s+(\d{1,2}/\d{2}/\d{4})