Create Exchange Rate Filters by your own
If a webpage provides exchange rates, you can import these values into the NumericalChameleon. The website has to provide exchange rates and their corresponding ISO-4217-codes (e. g. USD, EUR, etc.). It doesn' matter whether the ISO codes are visible in the HTML page, they only have to appear in the source code of the HTML page, even the presence of a link is sufficient.
The ISO-codes are stored in "<installationdirectory>/data/lists/iso4217.list". You can delete lines in this file to specify only the exchange rates you want.
Exchange Rates Filters are being stored in the folder called "<installationdirectory>/data/rates/" and the name of a filter file has to end with the suffix ".filter". Exchange rates filters have been stored in ISO 8859-1 before NumericalChameleon 2.0.0. Starting with NumericalChameleon 2.2.0, exchange rates filters have to be stored in UTF-8.
Example
Example of the filter file for the webseite
"The University of British Columbia"
(<installationdirectory>/data/rates/fx.sauder.ubc.ca.filter)
name=PACIFIC Exchange Rate Service provider=The University of British Columbia: Sauder School of Business visit=http://fx.sauder.ubc.ca/supplement.html version=20180714 country=ca continent=na instruction=\ Visit the website above. Respect the "Terms of Use"\n\ at the webpage. Save the webpage to a file and\n\ go to step 3.\n\ \n\ IMPORTANT: If you use the Internet Explorer (IE), select\n\ the option "Save as type: Web Page, HTML only" at the\n dialog called "Save Web Page", otherwise the IE rewrites\n\ (destroys) the original HTML of the exchange rate provider\n\ and this filter doesn't work anymore! instruction_de=\ Besuchen Sie obige Webseite. Respektieren Sie die\n\ Nutzungsbedingungen auf der Webseite. Speichern Sie die\n\ Webseite als Datei ab und gehen Sie zu Schritt 3.\n\ \n\ WICHTIG: Wenn Sie den Internet Explorer (IE) verwenden,\n\ wählen Sie beim Dialog "Webseite speichern" den Dateityp\n\ "Webseite, nur HTML". Wenn Sie "Webseite, komplett" wählen,\n\ zerstört der IE das HTML-Originalformat des Wechselkurs-\n\ anbieters und dieser Filter funktioniert dann nicht mehr. date=<title>Today's FX Rates Supplement for ([^<]+)</title> before_iso=<tt> after_iso=</tt></td>\ \\s*<td[^>]+>[^<]+</td>\ \\s*<td[^>]+>([\\d\\.]+)[^<]*</td> valuepos=1 decimalSeparator=, decimalPoint=. filechooser=htm,html base=CAD directDownload=true user-agent=random
Description of all keywords:
Keyword | Required | Datatype | Default | Impact | Since NC |
Obsolete since NC |
Description |
enabled | - | Boolean | true | Functional | 2.0.0 | Specifies whether the exchange rates filter is active or not (true or false), if the key is missing, the filter is enabled | |
name | x | String | Visual | 1.2.0 | The name of the exchange rate service | ||
provider | x | String | Visual | 2.2.0 | The name of the exchange rate service provider | ||
country | x | String | Visual | 2.0.0 | The country where the exchange rate service is located | ||
continent | x | String | Visual | 2.2.0 | The continent where the exchange rate service is located | ||
version | - | Integer | Visual | - | Not used by the application for now | ||
visit | x | URL | Filter | 1.2.0 | The URL of the exchange rate service | ||
visit.additional | - | Integer | Filter | 2.0.0 | Number; how many additional addresses are available? | ||
visit.<number> | - | URL | Filter | 2.0.0 | An additional address of the exchange rate service | ||
description | x | String | Visual | 1.2.0 | 2.2.0 | A short description of the exchange rate service, will be used if there is no suitable description_<language> entry | |
description_<language> | - | String | Visual | 2.0.0 | 2.2.0 | Like description, but localized, <language> must be a two-character code according to ISO 3166, "de" for german for example | |
instruction | x | String | Visual | 1.2.0 | Some instructions what to do at the website of the exchange rate service, will be used if there is no suitable instruction_<language> entry | ||
instruction_<language> | - | String | Visual | 2.0.0 | Like instruction, but localized, <language> must be a two-character code according to ISO 3166, "de" for german for example | ||
date | x | Regex | Filter | 1.2.0 | A regular expression for the date, brackets define the actual string of the date. If you set date=today the current date is used for the date. | ||
before_iso | x | Regex | Filter | 1.2.0 | A regular expression before the ISO 4217 code, brackets will define strings | ||
before_iso_inv | x | Regex | Filter | 1.5.0 | A regular expression before the ISO 4217 code, brackets will define strings (rate will be recalculated with 1/rate) | ||
after_iso | x | Regex | Filter | A regular expression after the ISO 4217 code, brackets will define strings | |||
after_iso_inv | x | Regex | Filter | 1.5.0 | A regular expression after the ISO 4217 code, brackets will define strings (rate will be recalculated with 1/rate) | ||
decimalSeparator | - | Character | Filter | 1.2.0 | Which character represents the thousand separator? | ||
decimalPoint | - | Character | Filter | 1.2.0 | Which character represents the decimal point? | ||
logic | - | Boolean | false | Filter | 1.3.0 | Will be put in in field logic of category "exchange rates" | |
filechooser | - | csv of Strings | Visual | 1.3.0 | Which file postfixes should be supported by the open dialog? (e. g. "html, htm") | ||
valuepos | - | Integer | 1 | Filter | 1.3.0 | What bracket defines the value in string "before_iso+ISO+after_iso"? (e. g. "3") | |
base | - | String | Filter | 1.4.0 | A three character ISO 4217 code which represents factor 1, (e. g. "USD") | ||
factorpos | - | Integer | Filter | 2.0.0 | Which bracket content defines the factor of the value in the string "before_iso+ISO+after_iso"? (e. g. "3"); use either factorpos or factorForAll | ||
factorForAll | - | Decimal | Filter | 2.0.0 | The exchange rate is the price in the "base" unit for "factorForAll" units of the foreign currency; use either factorpos or factorForAll | ||
removeTags | - | Boolean | false | Filter | 2.0.0 | The value can contain HTML-tags, if "true" those tags will be removed. | |
removeTagsBeforeParsing | - | Boolean | false | Simplifying of the regex; Performance | 2.2.0 | Before parsing, all HTML tags are being removed, this allows a more simplified regex | |
removeWhitespaces | - | Boolean | false | Filter | 2.0.1 | The value can contain whitespaces, if "true" those whitespaces will be removed. | |
replaceCodes | - | Boolean | false | Filter | 2.0.0 | The value can contain HTML-codes, if "true" those codes will be translated | |
removeCommentBeforeParsing | - | Boolean | false | Performance | 2.0.0 | All HTML comment blocks will be removed before the parsing. | |
searchOnlyFor | - | CSV of Strings | Performance | 2.0.0 | ISO codes must be separated by a comma, only those are taken into account for the search function. This option can improve the performance for parsing the values from a HTML page. On the other side of the coin, this increases also the effort which is necessary to keep a filter file up to date. | ||
cutHead | - | String | Performance | 2.0.0 | Cuts content from begin of the page to the end of the string cutHead. This option can improve the performance for parsing values from a HTML page, because less content must be parsed. | ||
cutHead.count | - | Integer | Performance | 2.0.1 | Specifies how often cutHead will be called | ||
cutBottom | - | String | Performance | 2.0.0 | Cuts content from the begin of the cutBottom string to the end of the page. This option can improve the performance for parsing values from a HTML page, because less content must be parsed. | ||
directDownload | - | Integer | Function | 2.0.0 | Specifies whether a direct download is suitable. Default is false. Set it to true only if the user isn't required to do any actions on a website. | ||
user-agent | - | String | Function | 2.0.0 | If set, the user-agent will be used as a parameter at the HTTP-header. If user-agent has been set to "random", a random user-agent is being used. | ||
charset | - | String | Filter | 3.0.0 | Most web pages today use UTF-8, so UTF-8 is the default character set for the input file. If it is necessary to deviate from this rule, e. g. even if the input file does not correctly describe its character set itself, the charset property can be used to specify the actual character set used. | ||
nonIsoCodesInFile | - | String | Filter | 3.0.0 | If special non-ISO codes occur in an input file (e.g., crypto currencies that have not yet been assigned an official ISO code equivalent), this directive can be used to specify the file where these codes can be found. The advantage is that such non-ISO code files can be referenced by multiple filters. | ||
useNonIsoCodesOnly | - | String | Performance | 3.0.0 | Defines whether only non-ISO codes are to be used. This ignores all official ISO codes except the currency that has been specified by "base". |