Reply to topic

The Problem with Online Quotes

empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Fri Mar 16, 2018 5:14 pm
Google changed output format. Parser does not work now :'( :

Code: Select all
[Online-Quote-Source-finance.google.com]
DateFormatRegex=%y-%m-%d
DateRegex="quoteTime"\\s+content="(\\d{4}-\\d{2}-\\d{2})T
PriceRegex="price"\\s+content="((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=%1
URL=https://finance.google.com/finance?q=%1


https://www.google.ru/search?q=INDEXSP:.INX
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Thu Mar 29, 2018 4:49 pm
Hi.
My favorite quotation site also changed it's pages.
exemple: http://www.boursorama.com/bourse/opcvm/ ... 0P0001B8DU
May I ask again for some help to retrieve the prizes and dates ?

Thank you
mcarpino
Registered Member
Posts
69
Karma
0
OS

Re: The Problem with Online Quotes

Thu Mar 29, 2018 6:47 pm
On March 17th mdolnik posted this solution for quotes. viewtopic.php?f=69&t=142713&start=15 The following is his fix here for your use. Hope it's helpful.

It looks like the https://finance.google.com/finance?q=%1 link is no longer working as Google has updated their Finance site.

I haven't been able to figure out how to get google working anymore with its new changes, but I have found a way to get stock quotes and currency working with Yahoo (working as of 2018-03-17).

New / EDIT Online Stock Quote
Add a new Online Stock Quote (or edit the existing Yahoo entry)
Settings > Configure KMyMoney... > Online Quotes
Set values to the following:
Code: Select all
URL: https://query1.finance.yahoo.com/v7/fin ... e&symbols=%1
Symbol: %1
Price: "regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)
Date: "regularMarketTime":([\d]+)
Date Format: [empty]
Skip HTML stripping: [checked]


EDIT Online Currency Quote
Edit the "Yahoo Currency" Online Currency Quote (It looks like you cannot change the currency source so you have to modify the Yahoo Currency entry)
Settings > Configure KMyMoney... > Online Quotes
Set values to the following:
Code: Select all
URL: https://query1.finance.yahoo.com/v7/fin ... e&symbols=%1%2=X
Symbol: %1
Price: "regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)
Date: "regularMarketTime":([\d]+)
Date Format: [empty]
Skip HTML stripping: [checked]
malato
Registered Member
Posts
1
Karma
0

Re: The Problem with Online Quotes

Wed Apr 25, 2018 6:20 pm
Hiya
i have quite a hard time to make kmymoney recognize my stocks and funds: they're almost all italian, but one irish fund
any idea what should i do?
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Sat Jul 21, 2018 5:19 pm
Hi
I'm having some trouble with the windows version.
For some reasons I can't get the online currency to work.
Here are my settings: (using the ones above)
Image

And the error message when I try to update the currencies (in this case swiss francs to euros)
Image

for some reasons I can't figure something is added to the URL.
User avatar ipwizard
KDE Developer
Posts
616
Karma
2
OS

Re: The Problem with Online Quotes

Sat Jul 21, 2018 5:56 pm
I am wondering, where this %0A%0A comes from at the end of the URL. Is this an EOL problem, since %0A is a LineFeed? Which version of KMyMoney is this?


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.0 64bit, KF5
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Sun Jul 22, 2018 6:44 am
This is version 4.8.1 for Windows
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Tue Nov 27, 2018 4:03 am
I collected all scripts for parsing different sites. They work for me. :)
I hope this will be useful to someone.

The easiest way is insert all codes in file "kmymoneyrc".
Windows 10 path: "c:\Users\USER1\AppData\Roaming\.kde4\share\config\kmymoneyrc"

Code: Select all
[Online-Quote-Source-KMyMoney Currency]
CSVURL=
DateFormatRegex=%d/%m/%y
DateRegex=updated\\s\\d+:\\d+:\\d+\\(\\w+\\)\\s+(\\d{1,2}/\\d{2}/\\d{4})
IDBy=0
IDRegex=https://fx-rate.net/([^/]+/[^/]+)
PriceRegex=1\\s[^=]+\\s=</span><br\\s/>\\s([^\\s]+)
SkipStripping=true
URL=https://fx-rate.net/%1/%2

[Online-Quote-Source-Yahoo Currency]
DateFormatRegex=%d/%m/%y
DateRegex=updated\\s\\d+:\\d+:\\d+\\(\\w+\\)\\s(\\d{1,2}\\/\\d{2}\\/\\d{4})
PriceRegex=1\\s[^=]+\\s=<\\/span><br\\s\\/>\\s([^\\s]+)
SkipStripping=true
SymbolRegex=href="https:\\/\\/fx-rate.net\\/([^\\/]+\\/[^\\/]+)
URL=https://fx-rate.net/%1/%2

[Online-Quote-Source-bonds.finam.ru corp]
DateFormatRegex=%d.%m.%y
DateRegex=Дата:</td>\r        <td align="right" bgcolor="#FFFFFF">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td align="right" bgcolor="#EFEFEF">[^0-9]*([0-9,\\s\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://bonds.finam.ru/issue/%1/default.asp

[Online-Quote-Source-bonds.finam.ru gov]
DateFormatRegex=%d.%m.%y
DateRegex=Дата:</td>\r        <td align="right" bgcolor="#FFFFFF">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td align="right" bgcolor="#EFEFEF">[^0-9]*([0-9,\\s\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://bonds.finam.ru/issue/%1/default.asp?resultsType=5

[Online-Quote-Source-boursorama.com bonds in % Berlin / Bremen ]
DateFormatRegex=%d/%m/%y
DateRegex=class="time-short">(\\+\\+\\+\\+\\+)
PriceRegex=<meta itemprop="price" content="([0-9]+.\\+)" />
SkipStripping=true
SymbolRegex=
URL=http://www.boursorama.com/cours.phtml?symbole=%1

[Online-Quote-Source-boursorama.com bonds in % Stuttgart]
DateFormatRegex=%d/%m/%y
DateRegex=change</td>\t\t\t    \t\t\t<td>(\\+\\+\\+\\+\\+)
PriceRegex=<b><span class="cotation">([0-9]+.\\+)
SkipStripping=true
SymbolRegex=
URL=http://www.boursorama.com/cours.phtml?symbole=%1

[Online-Quote-Source-domofond.ru realty Perm]
DateFormatRegex=%d.%m.%y
DateRegex=
PriceRegex='мар.18' ,[^0-9]*([0-9,\\s\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://www.domofond.ru/tseny-na-nedvizhimost/permskiy_kray/perm/sverdlovskiy-d219

[Online-Quote-Source-finance.google.com]
DateFormatRegex=%y-%m-%d
DateRegex="quoteTime"\\s+content="(\\d{4}-\\d{2}-\\d{2})T
PriceRegex="price"\\s+content="((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=%1
URL=https://finance.google.com/finance?q=%1

[Online-Quote-Source-finance.yahoo.com]
DateFormatRegex=
DateRegex="regularMarketTime":([\\d]+)
PriceRegex="regularMarketPrice":((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=%1
URL=https://query1.finance.yahoo.com/v7/finance/quote?fields=regularMarketPrice&symbols=%1

[Online-Quote-Source-gold.investfunds.ru coins]
DateFormatRegex=%d.%m.%y
DateRegex=style="text-align:left;">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td id="pos1" style="text-align:left;">[^0-9]*([0-9,\\s\\.]+).*</td>
SkipStripping=true
SymbolRegex=
URL=http://gold.investfunds.ru/cbr_coins/%1

[Online-Quote-Source-markets.businessinsider.com bonds in %]
DateFormatRegex=%m/%d/%y
DateRegex=\t\t\t\t\t\t\t\t\t(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<span class="price-row-price">([0-9.]+.\\d+)
SkipStripping=true
SymbolRegex=
URL=http://markets.businessinsider.com/bonds/%1

[Online-Quote-Source-morningstar.co.uk EUR]
DateFormatRegex=%d/%m/%y
DateRegex=class="heading"><br />(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=class="line text">EUR[^0-9]*([0-9,\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=%1

[Online-Quote-Source-morningstar.co.uk USD]
DateFormatRegex=%d/%m/%y
DateRegex=class="heading"><br />(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=class="line text">USD[^0-9]*([0-9,\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=%1

[Online-Quote-Source-news.yandex.ru/quotes/]
DateFormatRegex=%d.%m.%y
DateRegex=<td class="quote__date">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<span class="quote__sgn"></span>[^0-9]*([0-9,\\s\\.]+).*</td>
SkipStripping=true
SymbolRegex=
URL=https://news.yandex.ru/quotes/%1.html

[Online-Quote-Source-pif.investfunds.ru mutual funds]
DateFormatRegex=%d.%m.%y
DateRegex=<th width="14%" class="nowrap main">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td class="nowrap main"><b>[^0-9]*([0-9,\\s\\.]+).*</b></td>
SkipStripping=true
SymbolRegex=
URL=https://investfunds.ru/funds/%1/

[Online-Quote-Source-world.investfunds.ru/etf/]
DateFormatRegex=%d.%m.%y
DateRegex=<td class="text_left">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<div class="price left">[^0-9]*([0-9,\\s\\.]+).*
SkipStripping=true
SymbolRegex=
URL=https://investfunds.ru/etf/%1/

[Online-Quote-Source-www.boerse-berlin.com bonds]
DateFormatRegex=%d/%m/%y
DateRegex=_dateTime">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=_last">(\\d+\\.\\d+)
SkipStripping=true
SymbolRegex=
URL=https://www.boerse-berlin.com/index.php/Bonds?isin=%1
User avatar vistasp
Registered Member
Posts
3
Karma
0

Re: The Problem with Online Quotes

Thu Mar 14, 2019 1:18 pm
empenoso wrote:I collected all scripts for parsing different sites. They work for me. :)
I hope this will be useful to someone.

The easiest way is insert all codes in file "kmymoneyrc".
Windows 10 path: "c:\Users\USER1\AppData\Roaming\.kde4\share\config\kmymoneyrc"


Thank you so much! I'd been tearing my hair out because Bloomberg (which was fine earlier) had stopped working for no apparent reason. I'm using your script for Yahoo now.

Thanks once again.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], bigjuergo, Bing [Bot], blue_bullet, chan, EricDraven9891, Exabot [Bot], Google [Bot], hahong, jsalatas, Majestic-12 [Bot], nybac, rbreu, redboy, Sogou [Bot]