Update Web Price Quote Sources
ClosedPublic

Authored by wojnilowicz on Jun 14 2017, 7:00 PM.

Details

Summary

Some sources were added, some removed (no longer work and cannot be made
to work), and some updated.

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wojnilowicz created this revision.Jun 14 2017, 7:00 PM
tbaumgart accepted this revision.Jun 18 2017, 9:00 AM
tbaumgart added a subscriber: tbaumgart.

Though I would keep the non-working ones and mark them as such. Maybe someone fixes them.

This revision is now accepted and ready to land.Jun 18 2017, 9:00 AM

Though I would keep the non-working ones and mark them as such. Maybe someone fixes them.

I tried to fix every one of them and it's impossible. The ones that were possible to fix were updated, so it's no matter of someone looking at it or not.

Though I would keep the non-working ones and mark them as such. Maybe someone fixes them.

I tried to fix every one of them and it's impossible. The ones that were possible to fix were updated, so it's no matter of someone looking at it or not.

Then go for it.

habacker added inline comments.
kmymoney/converter/webpricequote.cpp
663

This is outdated too.

I got success using

"class=\"mod-tearsheet-overview__header__symbol\"><span>(.*)</span>", // symbol regexp
665

This and date regex is outdated too. The new one are:

"class=\"mod-ui-data-list__value\">([\\d,]*\\.\\d*)</span>", // price regexp
"Data delayed at least 15 minutes, as of (.*)\\.", // date regexp
wojnilowicz marked an inline comment as done.

Made only one "Financial Times" Quote Source after Ralf's comment

wojnilowicz added inline comments.Jun 20 2017, 5:42 PM
kmymoney/converter/webpricequote.cpp
663

What do you need that for?

665

There is shorter regexp for price.

habacker added inline comments.Jun 20 2017, 7:04 PM
kmymoney/converter/webpricequote.cpp
663

I assume this regex returns the complete symbol from the website. The old regex was broken and the new returns with a minor modification

Symbol found: 'LU0063916489:USD'

"class=\"mod-tearsheet-overviewheadersymbol\"><span>([a-zA-Z0-9:]+)</span>", // symbol regex

665

Using the price regex with http://funds.ft.com/uk/Tearsheet/Summary?s=AT0000639083 returns

Fetching URL http://funds.ft.com/uk/Tearsheet/Summary?s=LU0063916489...
Symbol found: 'LU0063916489:USD'
Date found: 'Mo. Jun 19 2017'
Unable to update price for LU0063916489 (no price or no date)

because the leading string contains spaces ("Price (EUR)") which is not covered by \D

At least you need

Price[\D ]+([\d,]*\d+\.\d+)

wojnilowicz marked an inline comment as done.Jun 20 2017, 7:15 PM
wojnilowicz added inline comments.
kmymoney/converter/webpricequote.cpp
663

Yes, but that's completely redundant, not used anywhere, and not stored.
It makes configuration complicated and less basic without giving any advantages.

665

It's not so here. I believe that might be new regular expression evaluator

This revision was automatically updated to reflect the committed changes.
wojnilowicz marked an inline comment as done.

It's not so here. I believe that might be new regular expression evaluator

I guess this is worth a 5.0 release note because any 4.8.x user upgrading to version 5 has to update all their local stored Web Price Quotes to be usable. This could be avoided by using "Price[\D ]+([\d,]*\d+\.\d+)" as price regex.