User login

How to add a source of download for units?

Since Skrooge 1.1.0, you can add your own source of download for units.

For that, you just have to add a file in $HOME/.kde/share/apps/skrooge/quotes/

This file must be a text file (extension .txt) like this:

#The URL of the source. %1 will be replaced by the internet code of the unit
url=http://stooq.com/q/l/?s=%1&f=sd2t2ohlcv&h&e=csv

#The mode (HTML or CSV). In HTML mode, only one value will be extracted from downloaded page. In CSV mode, a value per line will be extracted.
mode=CSV

#The regular expression for the price (see http://doc.qt.nokia.com/latest/qregexp.html)
price=%1,[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),.*

#The regular expression for the date (see http://doc.qt.nokia.com/latest/qregexp.html)
date=%1,([^,]*),.*

#The format of the date (see http://doc.qt.nokia.com/latest/qdate.html#fromString-2)
dateformat = yyyy-MM-dd

This is not so easy to define regular expression, so you can active Skrooge's traces by doing "export SKGTRACE=1".

Defaults sources are installed in: /usr/share/kde4/apps/skrooge/quotes/

Category: