There's a new update in Docturist: we've added support for tour operators' exchange rates. What does it mean? Tour operators settle foreign bookings in a currency, dollars or euros. Which makes sense: they have to settle with foreign counterparties while the exchange rate keeps changing.
So the price of a tour is usually given in a currency, while the operator accepts payments in rubles, converting them into the tour price at some rate. Not at the Central Bank rate, of course, but at the operator's own rate, which each operator sets on its own (usually a few rubles above the Central Bank rate).
In Docturist you can keep bookings either in rubles — manually converting everything you need — or in a currency. And if you keep them in a currency, questions usually come up: roughly how much is the tour in rubles today? How much is left to pay? How many dollars of the tour price should be counted if the tourist paid $1000?
Until today, Docturist showed calculations at the Central Bank rate, purely for illustration, which is only good for a rough estimate. For an exact figure, you could enter the conversion rate manually and see the amount.
But why do it manually when you can take the rate from the operator's website and use it to get exact amounts? So we got busy and added support for operators' rates. Now, if exchange rates are supported for the tour operator the booking is made with, they take priority over the Central Bank rates and the user gets exact calculations (manual input is still possible and takes precedence).
From a technical point of view, writing dozens of parsers is, of course, not my favorite pastime. Somewhere there's an SPA with hydration after load, so plain requests don't see the rates and you have to hunt for an API. Somewhere foreign IP addresses are banned, so you have to hand the AI fixtures manually to test the parser. One site went and banned well-known hosting address ranges, so you can't just parse it from a live server. And somewhere there's even a bot protection script, and you can't get the page HTML at all without playwright/puppeteer.
It's unpleasant to wade through these thickets: you're not stealing anything, it's all purely for the convenience of users who bring money to these very operators. But there are so many restrictions, as if it were some terrible secret and not a USD/EUR block displayed right on the home page.
Anyway, the first dozen operators have been conquered and added to the service — both as an automatic per-operator parser in the queue and as a fallback to manual input. Plus plans B and C in case everything breaks or someone bans our IP.
We keep working!
P.S. And if you're interested in the Central Bank exchange rates, check out the Currencypotamus bot.